Class EntityHelper
This helper class provider functionality for handling entities, for providers that have them. It keeps track of available and desired entities and answers questions about them.
Inherited Members
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
public class EntityHelper
Constructors
EntityHelper()
Construct the instance
Declaration
public EntityHelper()
Properties
Count
Get the number of currently registered entities
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
DesiredEntities
Get an array of the names of the currently desired (+mandatory) entities
Declaration
public string[] DesiredEntities { get; }
Property Value
Type | Description |
---|---|
string[] |
Methods
AddAvailableEntities(params ArchiveRowTypeInfo[])
Add one or more entities to the list of available entities
Declaration
public void AddAvailableEntities(params ArchiveRowTypeInfo[] entities)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRowTypeInfo[] | entities | Entities to be added |
GetAvailableEntities()
Get the list of currently available entities
Declaration
public List<ArchiveRowTypeInfo> GetAvailableEntities()
Returns
Type | Description |
---|---|
List<ArchiveRowTypeInfo> | List of currently available entities |
GetEntity(string)
Get an entity by name; return null if there is no match
Declaration
public ArchiveRowTypeInfo GetEntity(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | Entity name |
Returns
Type | Description |
---|---|
ArchiveRowTypeInfo | Matching entity info, or null |
IsAnyEntityDesired()
Determine if any entity at all is on the 'desired' or 'default' list
Declaration
public bool IsAnyEntityDesired()
Returns
Type | Description |
---|---|
bool |
IsAtLeastOneEntityDesired(List<ArchiveRowTypeInfo>)
Determine if at least one of the given entities is on the desired entity list
Declaration
public bool IsAtLeastOneEntityDesired(List<ArchiveRowTypeInfo> entities)
Parameters
Type | Name | Description |
---|---|---|
List<ArchiveRowTypeInfo> | entities | List of entities to test |
Returns
Type | Description |
---|---|
bool | true if at least one of the entity names matches a name on the desired entity list |
IsEntityDesired(string)
Determine whether a given entity name is on the desired entity list, or mandatory (not optional)
Declaration
public bool IsEntityDesired(string entityName)
Parameters
Type | Name | Description |
---|---|---|
string | entityName | Name to check |
Returns
Type | Description |
---|---|
bool | True if the name matches one on the desired list |
SetDefaultEntities(params string[])
Set default entities, restricted to those that match the list of available entities. Earlier 'default' flags will be overwritten! Non-matching entities will be quietly and safely ignored, by design.
Declaration
public void SetDefaultEntities(params string[] entities)
Parameters
Type | Name | Description |
---|---|---|
string[] | entities | One or more entity names to match |
SetDesiredEntities(params string[])
Set desired entities, restricted to those that match the list of available entities. Earlier 'desired' flags will be overwritten! Non-matching entities will be quietly and safely ignored, by design.
Declaration
public void SetDesiredEntities(params string[] entities)
Parameters
Type | Name | Description |
---|---|---|
string[] | entities | One or more entity names to match |