Class CodeSnippet
Assembly: LemonEdge.API.Entities.Auto.dll
Syntax
[DataContract]
public class CodeSnippet : BaseEntityWithPermissions, ICodeSnippet, IBaseEntityWithPermissions, ISetCopier, IHasVersion, IHasFolderStructure, IBaseEntity, IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties, ICloneableAsync<ICodeSnippet>, ISetCopierCloneAlterer
Constructors
CodeSnippet()
Declaration
Properties
ContextType
The type of item to to use as the formula context
Declaration
[StringLength(2000)]
public string ContextType { get; set; }
Property Value
CopierCloneType
Declaration
public SetCopierCloneType CopierCloneType { get; set; }
Property Value
Description
A user friendly description of this code snippet
Declaration
[StringLength(2000)]
public string Description { get; set; }
Property Value
EntityID
The id of the item to be passed into the formula context
Declaration
public Guid? EntityID { get; set; }
Property Value
EntityID_Label
Declaration
public string EntityID_Label { get; set; }
Property Value
EntityID_Label_Silent
Declaration
[NotMapped]
public string EntityID_Label_Silent { get; set; }
Property Value
EntityTypeID
The type of the item to be passed into the formula context
Declaration
public Guid? EntityTypeID { get; set; }
Property Value
FolderID
The link to the folder this item is contained in
Declaration
public Guid? FolderID { get; set; }
Property Value
FolderID_Label
Declaration
public string FolderID_Label { get; set; }
Property Value
FolderID_Label_Silent
Declaration
[NotMapped]
public string FolderID_Label_Silent { get; set; }
Property Value
IsSystem
Indicates this item is part of the core system. Any changes will be overwritten if the version number is lower than
the provided version number and the item is also marked as a system item.
Declaration
[Required]
public bool IsSystem { get; set; }
Property Value
Name
[Key] A unique friendly name for this code snippet.
Declaration
[Unique]
[Required]
[StringLength(500)]
public string Name { get; set; }
Property Value
Snippet
Declaration
public string Snippet { get; set; }
Property Value
Version
Indicates the version number of this item. Changes will only be overwritten if the provided new item has a higer
version number than this one.
Declaration
[Required]
[DatabasePropertyValidation("MyItem.IsSystem", "var allUserTeams = await Cache.GetAllItems<LemonEdge.API.Entities.Administration.IUserTeam>(); (await Cache.GetAllItems<LemonEdge.API.Entities.Administration.ITeam>()).Any(x => allUserTeams.Where(ut => ut.UserID == User.ID).Select(ut => ut.TeamID).Contains(x.ID) && x.CanEditSystemItems)", "User is not authorized to modify system items.")]
public short Version { get; set; }
Property Value
Methods
AlterCopiedItem(IEntityUpdater, UserInfo, IReadOnlyCache, IBaseEntity)
A custom ability to alter this item when it is was copied by the user in the UI, not when it is being imported
Declaration
public Task AlterCopiedItem(IEntityUpdater host, UserInfo user, IReadOnlyCache cache, IBaseEntity sourceItem)
Parameters
Returns
Type |
Description |
Task |
A task inidicating the finishing of this method
|
CopyFromEntity(IBaseEntity)
Declaration
protected override void CopyFromEntity(IBaseEntity src)
Parameters
Overrides
CopyFromSource(ICodeSnippet)
Updates all properties in this item to have the same properties as the source object.
Declaration
public void CopyFromSource(ICodeSnippet source)
Parameters
Type |
Name |
Description |
ICodeSnippet |
source |
The source object to copy all values from.
|
Determines whether the source item should be copied based on the provided relationship
Declaration
public bool CopyRelatedItem(IBaseEntity sourceItem, EntityRelationship rel)
Parameters
Type |
Name |
Description |
IBaseEntity |
sourceItem |
The original source item this item was copied from
|
EntityRelationship |
rel |
The particular relationship from the source item
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Overrides
Implements
Extension Methods