Interface IHasVersion
Indicates this entity has versioning capability provided by the system. Typically implemented by an entity that also implements ISetCopier.
When the entity (and sub items) are exported to xml, and imported back in the system will only import if the item does not already exist or has a lower version.
Namespace: LemonEdge.API.Entities
Assembly: API.dll
Syntax
public interface IHasVersion
Properties
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
[EntityProperty(SQLType.Bit, false, "0")]
[EntityDescription("Indicates this item is part of the core system. Any changes will be overwritten if the version number is lower than the provided new system version number.")]
[Required]
bool IsSystem { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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
[EntityProperty(SQLType.SmallInt, false, "1")]
[EntityDescription("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.")]
[Required]
[DatabasePropertyValidation("MyItem.IsSystem", "var allUserTeams = await Cache.GetAllItems<LemonEdge.API.Entities.IUserTeam>(); (await Cache.GetAllItems<LemonEdge.API.Entities.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.")]
short Version { get; set; }
Property Value
Type | Description |
---|---|
System.Int16 |