Search Results for

    Show / Hide Table of Contents

    Class Helper

    A helper class for working with new entities in the lemonedge system

    This ensures all configured processes, settings and workflow are applied to all new items when they are created either by a user or the system itself

    Inheritance
    System.Object
    Helper
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.API.Entities
    Assembly: API.dll
    Syntax
    public static class Helper

    Methods

    CanCreate(EntityDescriptor, UserInfo, IReadOnlyCache)

    Returns true if the specified user has permissions to create the specified type of entity

    Declaration
    public static Task<bool> CanCreate(EntityDescriptor forEntity, UserInfo userInfo, IReadOnlyCache cache)
    Parameters
    Type Name Description
    EntityDescriptor forEntity

    The type of entity to check if the user has permissions to create

    UserInfo userInfo

    The currently logged in user

    IReadOnlyCache cache

    A local cache

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    True if the specified user has permissions to create the specified type of entity

    CreateNewItem(Type, UserInfo, IReadOnlyCache, IEntityUpdater)

    Creates a new instance of the specified entity ensuring all custom values, watchers and other processes are run against it where configured

    Declaration
    public static Task<IBaseEntity> CreateNewItem(Type type, UserInfo userInfo, IReadOnlyCache cache, IEntityUpdater updater)
    Parameters
    Type Name Description
    System.Type type

    The type of entity to create

    UserInfo userInfo

    The currently logged in user

    IReadOnlyCache cache

    A local cache

    IEntityUpdater updater

    An optional context this item should be created in. The system will log the item as new, as well as any other new items/changes that occur due to this item being created (such as the creation of automatic watchers). If this is null then it can not log anything and so will not run any custom processes.

    Returns
    Type Description
    System.Threading.Tasks.Task<IBaseEntity>

    A new instance of the specified entity ensuring all custom values, watchers and other processes are run against it where configured

    CreateNewItem(Type, UserInfo, IReadOnlyCache, IEntityUpdater, Action<IBaseEntity>)

    Creates a new instance of the specified entity ensuring all custom values, watchers and other processes are run against it where configured

    Declaration
    public static Task<IBaseEntity> CreateNewItem(Type type, UserInfo userInfo, IReadOnlyCache cache, IEntityUpdater updater, Action<IBaseEntity> onCreated)
    Parameters
    Type Name Description
    System.Type type

    The type of entity to create

    UserInfo userInfo

    The currently logged in user

    IReadOnlyCache cache

    A local cache

    IEntityUpdater updater

    An optional context this item should be created in. The system will log the item as new, as well as any other new items/changes that occur due to this item being created (such as the creation of automatic watchers). If this is null then it can not log anything and so will not run any custom processes.

    System.Action<IBaseEntity> onCreated

    A callback function that provides the caller a chance to setup any initial values for the newly created item before default and configured processes are run on it

    Returns
    Type Description
    System.Threading.Tasks.Task<IBaseEntity>

    A new instance of the specified entity ensuring all custom values, watchers and other processes are run against it where configured

    CreateNewItem<T>(UserInfo, IReadOnlyCache, IEntityUpdater)

    Creates a new instance of the specified entity ensuring all custom values, watchers and other processes are run against it where configured

    Declaration
    public static Task<T> CreateNewItem<T>(UserInfo userInfo, IReadOnlyCache cache, IEntityUpdater updater)
        where T : IBaseEntity
    Parameters
    Type Name Description
    UserInfo userInfo

    The currently logged in user

    IReadOnlyCache cache

    A local cache

    IEntityUpdater updater

    An optional context this item should be created in. The system will log the item as new, as well as any other new items/changes that occur due to this item being created (such as the creation of automatic watchers). If this is null then it can not log anything and so will not run any custom processes.

    Returns
    Type Description
    System.Threading.Tasks.Task<T>

    A new instance of the specified entity ensuring all custom values, watchers and other processes are run against it where configured

    Type Parameters
    Name Description
    T

    The type of entity to create

    GetCloneContext(UserInfo, IReadOnlyCache, IEntityUpdater)

    Returns a new clone context for use when cloning entities in the system

    Declaration
    public static BaseEntityCloneContext GetCloneContext(UserInfo user, IReadOnlyCache cache, IEntityUpdater updater)
    Parameters
    Type Name Description
    UserInfo user

    The currently logged on user to add to the context

    IReadOnlyCache cache

    A local cache

    IEntityUpdater updater

    The current context the item is to be cloned with

    Returns
    Type Description
    BaseEntityCloneContext

    A new clone context for use when cloning entities in the system

    In This Article
    Back to top © LemonTree Software Ltd. All rights reserved.