Interface IBaseEntity
This is the base interface all entities within LemonEdge must implement.
All the properties on this base interface are implemented by *every* entity in LemonEdge, and thus exist as columns for every table in the database
Inherited Members
Namespace: LemonEdge.API.Core
Assembly: API.dll
Syntax
public interface IBaseEntity : IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties
Properties
AccountID
Links to UniqueAccountID. LemonEdge is a multi-tenanted system, and thus you can have several different accounts all residing in the same database
The default root account is 1
This property holds the account the item belongs to. It can not be modified by a user, it is maintained internally by the system
Declaration
[EntityProperty(SQLType.BigInt, false)]
long AccountID { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
CanvasID
Links to ICanvas. If this record is within a canvas, this holds the canvas id for the record.
By ensuring all items in the system have a canvas property, we can guarantee a mechanism for isolating canvases and ensuring all entities are compatabile with them
Declaration
[EntityProperty(SQLType.UniqueIdentifier, true)]
[EntityRelationship(EntityID.Canvas, "ID", SingleJoinType.ZeroToOne, "Canvas", "Contained In Canvas", DeleteWithRelationship = true, PartOfParentSet = false, LinkToItemInSet = false, PreventAutoConstraint = true)]
Guid? CanvasID { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
ID
All items in the system have a globally unique id.
This is used instead of auto-increment numbers for several reasons, but the main one being it enables all entities to be designed to cope with importing/exporting/copying. It is very easy to create an entire copy of an account into another one by maintaining the same ids
Declaration
[EntityProperty(SQLType.UniqueIdentifier, false)]
Guid ID { get; set; }
Property Value
Type | Description |
---|---|
System.Guid |
LastUpdated
The server datetime stamps of when this item was last udpated in the system
By ensuring every record has a datetimestamp for changes, and by keeping all old records, we can ensure the entire system can be ran as of any point in time in the past
Declaration
[EntityProperty(SQLType.DateTimeOffset, false)]
DateTimeOffset LastUpdated { get; set; }
Property Value
Type | Description |
---|---|
System.DateTimeOffset |
Remarks
We should always use datetimeoffsets. They are international, with time zones, but most importantly odata supports them and not datetime
ModifiedByUserID
Links to IUser. This holds the id of the user that made the change to the item
Declaration
[EntityProperty(SQLType.UniqueIdentifier, false, FriendlyLabel = "Modified By User")]
[EntityRelationship(EntityID.Users, "ID", SingleJoinType.One, "Modified By User", "Modifications Made By User", LinkToItemInSet = false)]
Guid ModifiedByUserID { get; set; }
Property Value
Type | Description |
---|---|
System.Guid |
Methods
GetLabel(String)
For properties that are Guid properties holding a relationship to another entity, this function returns the label held for that id
This is done by the class that implements this interface holding a xxx_Label property for every xxx Guid relationship property with a label
Declaration
string GetLabel(string propName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propName | The Guid relationship property name to return the label for that item of |
Returns
Type | Description |
---|---|
System.String | The label held for the specified guid relationship property |
SetLabel(String, String)
For properties that are Guid properties holding a relationship to another entity, this function can be used to set the label held for that id
This is used throughout the client UI by the platform to update the labels held when users choose different items for relationships so the UI immediately reflects these choices
This is done by the class that implements this interface holding a xxx_Label property for every xxx Guid relationship property with a label
Declaration
void SetLabel(string propName, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | propName | The Guid relationship property name to update the label for that item of |
System.String | value | The new label value for the corrosponding property id |
SetSilentLabel(String, String)
The same as SetLabel(String, String) except done without raising any System.ComponentModel.INotifyPropertyChanged events
Declaration
void SetSilentLabel(string propName, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | propName | The Guid relationship property name to update the label for that item of |
System.String | value | The new label value for the corrosponding property id |