Skip to content

Carrot.Data.Scaffold.Core

net

Foundational infrastructure for the scaffold system - type reflection, graph model, naming, annotations, definitions, and property resolution.

Usage

csharp
using Carrot.Data.Scaffold.Reflected;
using Carrot.Data.Scaffold.Graph;
using Carrot.Data.Scaffold.Graph.Naming;
using Carrot.Data.Scaffold.Definitions;
using Carrot.Data.Scaffold.Configure;

Contents

Reflection: ScaffoldReflectedType · ScaffoldReflectedProperty - cached CLR type/property introspection with 15+ shape flags.

Graph: ScaffoldGraph · IScaffoldGraphType · IScaffoldGraphConversion - abstract graph model with type awareness and annotations.

Naming: ScaffoldGraphNamed hierarchy - five naming strategies from raw identifiers to CodeName-integrated casing/pluralization with optional rename support.

Annotations: ScaffoldGraphAnnotationProvider - dictionary-backed annotation system with set-once, overwrite, list-add, and list-remove merge modes.

Providers: ScaffoldGraphProviderListBase<T> · ScaffoldGraphProviderDictionaryBase<TKey, TValue> - generic collection infrastructure for graph data.

Definitions: IScaffoldDefine hierarchy - marker interfaces for declarative (string-keyed), introspective (Type-keyed), and conversion definitions.

Property resolution: PropertyNameResolverCore - expression tree and string-based property resolution with scalar validation.

Build

bash
dotnet build

Carrot.Data.Scaffold.Core - Contents

Package: Carrot.Data.Scaffold.Core

Reflection

  • ScaffoldReflectedType - cached CLR type introspection (properties, interfaces, attributes, type shape flags)
  • ScaffoldReflectedProperty - cached CLR property introspection (raw/unwrapped types, entity/collection detection, nullability)
  • ScaffoldReflectedBase - base class combining a CLR type with its reflected type and underlying element type
  • IScaffoldReflectedTypeShape - shape contract exposing IsAbstract, IsCollection, IsRecord, IsScalar, IsEnum, etc.

Graph

  • IScaffoldGraph - root graph node interface (extends IScaffoldGraphNamed)
  • ScaffoldGraph - abstract base class for graph nodes
  • IScaffoldGraphType - graph node that carries a CLR type and reflected type, with annotations
  • IScaffoldGraphConversion - marker interface for graph conversion nodes
  • IScaffoldGraphAnnotation - annotation contract (Key, Source, AsString(), AsStrings())
  • ScaffoldGraphAnnotationBase - abstract annotation base
  • ScaffoldGraphAnnotation - single-value annotation
  • ScaffoldGraphAnnotationList - multi-value annotation backed by List<object>
  • ScaffoldInheritanceScope - enum: Interface, Extends

Graph Naming

  • IScaffoldGraphNamed - base naming contract (RawIdentifier)
  • IScaffoldGraphNamedCodeName - naming with CodeName, casing, pluralization, humanization
  • IScaffoldGraphNamedCodeNameCustomisable - code-name naming with rename support
  • IScaffoldGraphNamedFixed - fixed naming (GetName())
  • IScaffoldGraphNamedCustomisable - fixed naming with rename support
  • IScaffoldGraphNamedCanCustomise - customisation contract (CustomName, IsRenamed)
  • ScaffoldGraphNamed - abstract base for named graph nodes
  • ScaffoldGraphNamedCodeName - abstract base with CodeName integration
  • ScaffoldGraphNamedCodeNameCustomisable - code-name base with rename support
  • ScaffoldGraphNamedFixed - abstract fixed-name base
  • ScaffoldGraphNamedCustomisable - fixed-name base with rename support

Graph Providers

  • ScaffoldGraphProviderBase - abstract provider base (Clear, Count)
  • ScaffoldGraphProviderBase<T> - enumerable provider base with Find, TryFind, GetAll
  • ScaffoldGraphProviderListBase<T> - list-backed provider with Add, Remove, CopyFrom, OfType<T>
  • ScaffoldGraphProviderDictionaryBase<TKey, TValue> - dictionary-backed provider with Get, GetOrCreate, TryGet, Overwrite
  • ScaffoldGraphAnnotationProvider - annotation-specific dictionary provider with Set, Overwrite, ListAdd, ListRemove, Merge, IncludeExternal
  • IScaffoldHasAnnotations - contract for graph nodes that carry an Annotations provider
  • AnnotationMergeMode - enum: Set, Overwrite, ListAdd, ListRemove

Definitions

  • IScaffoldDefine - base definition marker (LogicalName)
  • IScaffoldDefine<TKey> - keyed definition (GraphKey)
  • IScaffoldDefineConversion - conversion definition marker
  • IScaffoldDefineConversion<TA, TB> - typed conversion definition
  • IScaffoldDefineDeclarative - string-keyed declarative definition
  • IScaffoldDefineIntrospective - Type-keyed introspective definition
  • IScaffoldDefineIntrospectiveAbstract - Type-keyed abstract introspective definition

Configuration

  • IScaffoldConfigure - configuration marker interface
  • IScaffoldConfigureTypeModel - configuration contract carrying a graph reference
  • ScaffoldConfigureAnnotations - fluent annotation configuration helper (Set, Overwrite, ListAdd, ListRemove, Remove)

Attributes

  • ScaffoldGraphCollectionAttribute - marks a property as a graph collection with optional back-reference and graph type
  • ScaffoldGraphKeyAttribute - marks a property as a graph key linked to a definition type
  • ScaffoldTemplateAssembly - assembly-level attribute marking an assembly as a scaffold template (with optional SubType)
  • ScaffoldTemplateAssemblyExtensions - extension methods IsScaffoldTemplate(), IsInScaffoldTemplate()

Property Resolution

  • PropertyNameResolverCore - resolves property names from expression trees or string lists, with scalar-only validation and duplicate detection

Exceptions

  • FailedToDetermineScaffoldNameException
  • MultipleScaffoldsDiscoveredException
  • ScaffoldAnnotationAlreadySetException
  • ScaffoldCannotAddToSimpleAnnotationException
  • ScaffoldCouldNotResolveNameException
  • ScaffoldDefinitionTypeNotOpenGenericException
  • ScaffoldFailedToAddAnnotationListException
  • ScaffoldMethodNotFoundException
  • ScaffoldPropertyNotFoundException
  • ScaffoldPropertyNotFoundException<TProperty>

Carrot