SDK: Adding Create Actions (Advanced)
  • 25 Jan 2022
  • 1 Minute to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

SDK: Adding Create Actions (Advanced)

  • Dark
    Light

Article summary

Version 7.x .NET Architecture Change


Adding this interface to a 'service' that is created.

public class MyEntityService : BaseEntityService<MyEntity>
{
   public override BaseActionType[] GetCreateMethods(Folder folder, AbstractUserContext userContext)
   {
       List<BaseActionType> actions = new List<BaseActionType>();
      
       return actions.ToArray();
   }
}


Creating entity action factory registered to 'folder'.

public class MyEntityService : BaseEntityService<MyEntity>
{
   public virtual void Initialize()
   {
       EntityActionFactoriesHolder.GetInstance().RegisterObjectForType(typeof(Folder), new MyFolderActionFactory());
   }
}

public class MyFolderActionFactory : IEntityActionFactory
{
   public BaseActionType[] GetActions(AbstractUserContext userContext, EntityActionType[] actionTypes, IPlatformEntity target, string entityId)
   {
       List<BaseActionType> list = new List<BaseActionType>();
      
       return list.ToArray();
   }
}



Was this article helpful?