Show / Hide Table of Contents

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.

Inheritance
Object
EntityHelper
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
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
Int32

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(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
Boolean

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
Boolean

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
Boolean

True if the name matches one on the desired list

SetDefaultEntities(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(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

Extension Methods

EnumUtil.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top