Class SetItemInfo
A helper class used for holding all the information for importing/exporting a LemonEdge entity and all its related child items
Implements
Inherited Members
Namespace: LemonEdge.API.Core.DataIntegration
Assembly: LemonEdge.API.dll
Syntax
[DataContract(IsReference = true)]
public class SetItemInfo : ISetItemInfo
Constructors
SetItemInfo(SetItemInfo, IBaseEntity, EntityDescriptor)
Declaration
public SetItemInfo(SetItemInfo parent, IBaseEntity source, EntityDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
SetItemInfo | parent | |
IBaseEntity | source | |
EntityDescriptor | descriptor |
SetItemInfo(IEnumerable<ISetItemInfo>)
Creates a new SetItemInfo that holds the specified collection of items as children
Declaration
public SetItemInfo(IEnumerable<ISetItemInfo> children)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ISetItemInfo> | children | The items to be children of this SetItemInfo |
Properties
Children
A list of all the child items of this SetItemInfo
Declaration
public List<SetItemInfo> Children { get; }
Property Value
Type | Description |
---|---|
List<SetItemInfo> |
CopiedEntity
During importing, this holds a new item that has been created as a copy of the SourceEntity with all the relevant relationships/etc updated accordingly
Declaration
public IBaseEntity CopiedEntity { get; set; }
Property Value
Type | Description |
---|---|
IBaseEntity |
Remarks
For instance if this SourceEntity references child items then the CopiedEntity would have those references updated to point to the new CopiedEntity for those child items rather than the original
Descriptor
Declaration
public EntityDescriptor Descriptor { get; set; }
Property Value
Type | Description |
---|---|
EntityDescriptor |
GetAllItems
Returns all items, including this one itself, in the tree through all child items
Declaration
public IEnumerable<SetItemInfo> GetAllItems { get; }
Property Value
Type | Description |
---|---|
IEnumerable<SetItemInfo> |
InvalidRelationships
During importing, a list of relationships that can't be linked to as they don't exist in this database
Declaration
public List<EntityRelationship> InvalidRelationships { get; set; }
Property Value
Type | Description |
---|---|
List<EntityRelationship> |
InvalidVersion
Indicates this SetItemInfo can't be imported as it has a version lower than the one currently in the system
Declaration
public bool InvalidVersion { get; set; }
Property Value
Type | Description |
---|---|
bool |
InvalidVersionEntity
During importing, this holds the item that has an invalid version and can't be imported as the current item has a higher version number
Declaration
public IBaseEntity InvalidVersionEntity { get; set; }
Property Value
Type | Description |
---|---|
IBaseEntity |
IsSameEntityID
Declaration
public bool IsSameEntityID { get; set; }
Property Value
Type | Description |
---|---|
bool |
LinkKeys
Declaration
public Dictionary<string, List<string>> LinkKeys { get; }
Property Value
Type | Description |
---|---|
Dictionary<string, List<string>> |
Parent
Declaration
public ISetItemInfo Parent { get; }
Property Value
Type | Description |
---|---|
ISetItemInfo |
Root
The top most item we are importing, or the root record, that holds all the children records that we are also that importing
Declaration
public SetItemInfo Root { get; }
Property Value
Type | Description |
---|---|
SetItemInfo |
RootSetItem
A root item we are importing which has child records. This may not be the root of the tree, if multiple items are being imported or if the root item has sub items that are importable themselves (like a query with sub-queries in it) we need to get hold of these sub-root records to know if they themselves are being imported as new, or updating an existing record i.e. a query may be being imported as new, but a sub-query it contains may just be being updated
Declaration
public SetItemInfo RootSetItem { get; }
Property Value
Type | Description |
---|---|
SetItemInfo |
SourceEntity
The source LemonEdge entity this SetItemInfo holds a definition of for copying
Declaration
[DataMember]
public IBaseEntity SourceEntity { get; set; }
Property Value
Type | Description |
---|---|
IBaseEntity |
SourceExtraInfo
Custom extra information stored from the source object
Declaration
[DataMember]
public string SourceExtraInfo { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
GetCopyInfo(IEntityUpdater, IBaseEntity)
Creates a SetItemInfo for the specified item. Will navigate all related items to this entity that should be included in a Set and create an ISetItemInfo for them too.
Declaration
public static Task<ISetItemInfo> GetCopyInfo(IEntityUpdater host, IBaseEntity item)
Parameters
Type | Name | Description |
---|---|---|
IEntityUpdater | host | The host context to load related items with |
IBaseEntity | item | The item to wrap in an ISetItemInfo |
Returns
Type | Description |
---|---|
Task<ISetItemInfo> | SetItemInfo for the specified item. Will navigate all related items to this entity that should be included in a Set and create an ISetItemInfo for them too. |
Remarks
Related items that are included come from the EntityRelationship attribute.
Marking a property relationship as PartOfParentSet would mean an item with that property pointing to this item would be included in this SetItemInfo as a child item
Any property on this item itself with a relationship marked as LinkToItemInSet would include the refernced item in this SetItemInfo as a child item