CkTypeGraph
Namespace: Meshmakers.Octo.ConstructionKit.Contracts.DependencyGraph
Represents a construction kit type in the dependency graph
public class CkTypeGraph : CkTypeWithAttributesGraph
Inheritance Object → CkTypeWithAttributesGraph → CkTypeGraph
Properties
DerivedFromCkTypeId
Defines the base type of this type. Only one type may not have a base type: System/Entity
public CkId<CkTypeId> DerivedFromCkTypeId { get; }
Property Value
CkTypeId
Gets or sets the construction kit id
public CkId<CkTypeId> CkTypeId { get; }
Property Value
IsFinal
If true, the type cannot be inherited again
public bool IsFinal { get; }
Property Value
IsAbstract
If true, the type cannot be instantiated by a runtime entity
public bool IsAbstract { get; }
Property Value
DefiningCollectionRootCkTypeId
Gets or sets the defining construction kit type id, which defines the collection in repository.
public CkId<CkTypeId> DefiningCollectionRootCkTypeId { get; private set; }
Property Value
IsCollectionRoot
Gets or sets a value indicating whether this type is a collection root. When true this type creates a collection in the database.
public bool IsCollectionRoot { get; private set; }
Property Value
BaseTypes
Returns a list of base types for the given construction kit type
public IReadOnlyCollection<CkGraphTypeInheritance> BaseTypes { get; }
Property Value
IReadOnlyCollection<CkGraphTypeInheritance>
DerivedTypes
Returns a list of derived types for the given construction kit type
public IReadOnlyCollection<CkGraphTypeInheritance> DerivedTypes { get; }
Property Value
IReadOnlyCollection<CkGraphTypeInheritance>
Associations
Returns a list of associations including inherited ones.
public CkGraphDirectedAssociations Associations { get; }
Property Value
Indexes
Returns a list of indexes including inherited ones.
public IReadOnlyCollection<CkTypeIndexDto> Indexes { get; set; }
Property Value
IReadOnlyCollection<CkTypeIndexDto>
EnableChangeStreamPreAndPostImages
Gets a value indicating whether the change stream should include pre- and post-images
for this type's collection. Required on the collection-root CK type for
fullDocumentBeforeChange filters to evaluate.
public bool EnableChangeStreamPreAndPostImages { get; }
Property Value
Description
An optional description of the type
public string Description { get; set; }
Property Value
DisplayNameRule
The effective rule computing rtDisplayName on save. Initialized with the rule declared on this type; during inheritance resolution an empty rule is filled from the nearest base type that declares one (see ).
public string DisplayNameRule { get; private set; }
Property Value
DisplayDescriptionRule
The effective rule computing rtDisplayDescription on save. Same inheritance semantics as CkTypeGraph.DisplayNameRule.
public string DisplayDescriptionRule { get; private set; }
Property Value
DisplayNameRuleDeclared
True when CkTypeGraph.DisplayNameRule was declared on this type itself (not inherited). Used to report rule validation errors only at the declaring type.
public bool DisplayNameRuleDeclared { get; }
Property Value
DisplayDescriptionRuleDeclared
True when CkTypeGraph.DisplayDescriptionRule was declared on this type itself (not inherited).
public bool DisplayDescriptionRuleDeclared { get; }
Property Value
OwnerAttributePath
The effective owner attribute path for owned-only data permissions: the String-terminated attribute path (Record segments allowed) whose value identifies the owning subject. Initialized with the path declared on this type; during inheritance resolution an empty path is filled from the nearest base type that declares one (see ). Null means ownership is the server-stamped rtCreatedBy.
public string OwnerAttributePath { get; private set; }
Property Value
OwnerAttributePathDeclared
True when CkTypeGraph.OwnerAttributePath was declared on this type itself (not inherited). Used to report validation errors only at the declaring type.
public bool OwnerAttributePathDeclared { get; }
Property Value
WriteAccess
The write restriction declared on this type itself (writeAccess); null when the type
declares none. Not merged with the base types: a write is checked against every block along the
inheritance chain (this type and each of CkTypeGraph.BaseTypes), all of which must allow it.
public CkTypeWriteAccessDto WriteAccess { get; }
Property Value
DeclaredImplements
CK v2: the interfaces declared on this type (implements), without inherited ones.
public IReadOnlyCollection<CkId<CkInterfaceId>> DeclaredImplements { get; private set; }
Property Value
IReadOnlyCollection<CkId<CkInterfaceId>>
AllImplementedInterfaces
CK v2: the interfaces this type implements, including those declared on base types. Completed by the inheritance resolver (see ).
public IReadOnlyCollection<CkId<CkInterfaceId>> AllImplementedInterfaces { get; private set; }
Property Value
IReadOnlyCollection<CkId<CkInterfaceId>>
DefinedMethods
CK v2: the methods declared on this type, without inherited ones.
public IReadOnlyCollection<CkMethodDto> DefinedMethods { get; private set; }
Property Value
IReadOnlyCollection<CkMethodDto>
AllMethods
CK v2: the methods of this type including inherited ones, keyed by method id
(e.g. ChangePassword-1). Completed by the inheritance resolver (see ).
public IReadOnlyDictionary<string, CkMethodGraph> AllMethods { get; private set; }
Property Value
IReadOnlyDictionary<String, CkMethodGraph>
Path
Returns a string that describes the inheritance chain
public string Path { get; }
Property Value
Visibility
CK v2 (F1.1-S4): the effective visibility (declared value, otherwise CkVisibilityDto.Public).
Settable so a cache written before CK v2 (no key) reads Public.
public CkVisibilityDto Visibility { get; set; }
Property Value
Derivable
CK v2 (F1.1-S4): the effective derivability — the declared value, otherwise Model in a
ckLanguage: 2 model and Any in a v1 model. The CK-language default is applied by the model
graph (CkModelGraph.ApplyCkV2Modifiers) because the element alone does not know its model's language.
public CkDerivableDto Derivable { get; set; }
Property Value
DefinedAttributes
Gets or sets a list of attributes that are defined by the current type
public IReadOnlyCollection<CkTypeAttributeDto> DefinedAttributes { get; }
Property Value
IReadOnlyCollection<CkTypeAttributeDto>
AllAttributes
Gets or sets a list of attributes including inherited ones.
public IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph> AllAttributes { get; }
Property Value
IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>
AllAttributesByName
Gets or sets a list of attributes including inherited ones.
public IReadOnlyDictionary<string, CkTypeAttributeGraph> AllAttributesByName { get; }
Property Value
IReadOnlyDictionary<String, CkTypeAttributeGraph>
Constructors
CkTypeGraph(CkId<CkTypeId>, CkCompiledTypeDto)
Creates a new instance of CkTypeGraph.
public CkTypeGraph(CkId<CkTypeId> ckTypeId, CkCompiledTypeDto ckTypeDto)
Parameters
ckTypeId CkId<CkTypeId>
ckTypeDto CkCompiledTypeDto
CkTypeGraph(CkId<CkTypeId>, Boolean, Boolean, Boolean, IReadOnlyCollection<CkGraphTypeInheritance>, CkId<CkTypeId>, CkId<CkTypeId>, IReadOnlyCollection<CkGraphTypeInheritance>, IReadOnlyCollection<CkTypeAttributeDto>, IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>, IReadOnlyCollection<CkTypeIndexDto>, CkGraphDirectedAssociations, String, Boolean, String, String, String, IReadOnlyCollection<CkId<CkInterfaceId>>, IReadOnlyCollection<CkId<CkInterfaceId>>, IReadOnlyCollection<CkMethodDto>, IReadOnlyDictionary<String, CkMethodGraph>, CkTypeWriteAccessDto)
Creates a new instance of CkTypeGraph.
public CkTypeGraph(CkId<CkTypeId> ckTypeId, bool isAbstract, bool isFinal, bool isCollectionRoot, IReadOnlyCollection<CkGraphTypeInheritance> baseTypes, CkId<CkTypeId> derivedFromCkTypeId, CkId<CkTypeId> definingCollectionRootCkTypeId, IReadOnlyCollection<CkGraphTypeInheritance> derivedTypes, IReadOnlyCollection<CkTypeAttributeDto> definedAttributes, IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph> allAttributes, IReadOnlyCollection<CkTypeIndexDto> indexes, CkGraphDirectedAssociations associations, string description, bool enableChangeStreamPreAndPostImages, string displayNameRule, string displayDescriptionRule, string ownerAttributePath, IReadOnlyCollection<CkId<CkInterfaceId>> declaredImplements, IReadOnlyCollection<CkId<CkInterfaceId>> allImplementedInterfaces, IReadOnlyCollection<CkMethodDto> definedMethods, IReadOnlyDictionary<string, CkMethodGraph> allMethods, CkTypeWriteAccessDto writeAccess)
Parameters
ckTypeId CkId<CkTypeId>
isAbstract Boolean
isFinal Boolean
isCollectionRoot Boolean
baseTypes IReadOnlyCollection<CkGraphTypeInheritance>
derivedFromCkTypeId CkId<CkTypeId>
definingCollectionRootCkTypeId CkId<CkTypeId>
derivedTypes IReadOnlyCollection<CkGraphTypeInheritance>
definedAttributes IReadOnlyCollection<CkTypeAttributeDto>
allAttributes IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>
indexes IReadOnlyCollection<CkTypeIndexDto>
associations CkGraphDirectedAssociations
description String
enableChangeStreamPreAndPostImages Boolean
displayNameRule String
displayDescriptionRule String
ownerAttributePath String
declaredImplements IReadOnlyCollection<CkId<CkInterfaceId>>
CK v2: interfaces declared on this type
allImplementedInterfaces IReadOnlyCollection<CkId<CkInterfaceId>>
CK v2: interfaces including inherited ones
definedMethods IReadOnlyCollection<CkMethodDto>
CK v2: methods declared on this type
allMethods IReadOnlyDictionary<String, CkMethodGraph>
CK v2: methods including inherited ones, keyed by method id
writeAccess CkTypeWriteAccessDto
The write restriction declared on this type (not inherited)
Methods
SetDefiningCollectionCkTypeId(CkId<CkTypeId>)
Sets the defining collection rot type id
internal void SetDefiningCollectionCkTypeId(CkId<CkTypeId> ckTypeId)
Parameters
ckTypeId CkId<CkTypeId>
CkTypeId of the defining collection
SetIsCollectionRoot(Boolean)
Defines if the current type is a collection
internal void SetIsCollectionRoot(bool isCollectionRoot)
Parameters
isCollectionRoot Boolean
Indicates if the current type is a collection root
InheritDisplayRules(String, String)
Fills empty display rules from a base type. Called during inheritance resolution walking from the nearest base type upward, so the nearest declared rule wins. A rule already set (declared on this type or inherited from a nearer base) is never overwritten.
internal void InheritDisplayRules(string baseDisplayNameRule, string baseDisplayDescriptionRule)
Parameters
baseDisplayNameRule String
The base type's effective display name rule
baseDisplayDescriptionRule String
The base type's effective display description rule
InheritOwnerAttribute(String)
Fills an empty owner attribute from a base type. Same nearest-wins semantics as : a name already set (declared on this type or inherited from a nearer base) is never overwritten.
internal void InheritOwnerAttribute(string baseOwnerAttributePath)
Parameters
baseOwnerAttributePath String
The base type's effective owner attribute name
InheritInterfaces(IEnumerable<CkId<CkInterfaceId>>)
CK v2: adds the interfaces of a base type to CkTypeGraph.AllImplementedInterfaces (set union, own declarations first). Idempotent.
internal void InheritInterfaces(IEnumerable<CkId<CkInterfaceId>> fromBase)
Parameters
fromBase IEnumerable<CkId<CkInterfaceId>>
The base type's declared interfaces
InheritMethods(IEnumerable<CkMethodGraph>)
CK v2: adds the methods of a base type to CkTypeGraph.AllMethods. A method id that is already present (declared on this type or inherited from a nearer base) is kept — re-declaring an inherited method is reported by the inheritance resolver (message 100). Idempotent.
internal void InheritMethods(IEnumerable<CkMethodGraph> fromBase)
Parameters
fromBase IEnumerable<CkMethodGraph>
The base type's declared methods
AddBaseTypes(IEnumerable<CkGraphTypeInheritance>)
Adds a list of base types of the current type
internal void AddBaseTypes(IEnumerable<CkGraphTypeInheritance> baseTypeList)
Parameters
baseTypeList IEnumerable<CkGraphTypeInheritance>
AddDerivedTypes(CkGraphTypeInheritance)
Adds a derived types of the current type
internal void AddDerivedTypes(CkGraphTypeInheritance ckGraphTypeInheritance)
Parameters
ckGraphTypeInheritance CkGraphTypeInheritance
MergeTextIndexes(IReadOnlyCollection<CkTypeIndexDto>)
Appends a list of indexes to the current type
internal void MergeTextIndexes(IReadOnlyCollection<CkTypeIndexDto> indexesToMerge)
Parameters
indexesToMerge IReadOnlyCollection<CkTypeIndexDto>
GetAllDerivedTypes(Boolean)
Returns a list of derived types for the given construction kit type
public IReadOnlyCollection<CkId<CkTypeId>> GetAllDerivedTypes(bool includeSelf)
Parameters
includeSelf Boolean
When true, the current type is included to the list
Returns
IReadOnlyCollection<CkId<CkTypeId>>
GetBaseTypes(Boolean)
Returns a list of base types for the given construction kit type
public IReadOnlyCollection<CkId<CkTypeId>> GetBaseTypes(bool includeSelf)
Parameters
includeSelf Boolean
When true, the current type is included to the list
Returns
IReadOnlyCollection<CkId<CkTypeId>>
ToString()
public string ToString()