C# Class Sdl.Web.Common.Mapping.SemanticSchema

Represents a Semantic Schema
Deserialized from JSON in schemas.json.
ファイルを表示 Open project: sdl/dxa-web-application-dotnet

Public Methods

Method Description
FindFieldBySemantics ( FieldSemantics fieldSemantics ) : Sdl.Web.Common.Mapping.SemanticSchemaField

Find SemanticSchemaField with given semantics.

GetEntityNames ( ) : string>.ILookup

Get the Schema's semantic entity/types names grouped per semantic vocabulary.

Using ILookup{TKey,TElement} rather than a Dictionary{TKey,TValue} because it will allow for duplicate keys.

GetModelTypeFromSemanticMapping ( Type baseModelType ) : Type

Determine a Model Type based on semantic mappings (and a given base model type).

This method makes it possible (for example) to let the Teaser.Media property get an instance of Image rather than just MediaItem (the type of the View Model property).

GetSemanticTypeNames ( ) : string[]

Gets semantic type names (qualified with Vocabulary ID) for the Schema.

Initialize ( Sdl.Web.Common.Configuration.Localization localization ) : void

Initializes an existing instance.

ToString ( ) : string

Provides a string representation of the object.

Method Details

FindFieldBySemantics() public method

Find SemanticSchemaField with given semantics.
public FindFieldBySemantics ( FieldSemantics fieldSemantics ) : Sdl.Web.Common.Mapping.SemanticSchemaField
fieldSemantics FieldSemantics The semantics to check against
return Sdl.Web.Common.Mapping.SemanticSchemaField

GetEntityNames() public method

Get the Schema's semantic entity/types names grouped per semantic vocabulary.
Using ILookup{TKey,TElement} rather than a Dictionary{TKey,TValue} because it will allow for duplicate keys.
public GetEntityNames ( ) : string>.ILookup
return string>.ILookup

GetModelTypeFromSemanticMapping() public method

Determine a Model Type based on semantic mappings (and a given base model type).
This method makes it possible (for example) to let the Teaser.Media property get an instance of Image rather than just MediaItem (the type of the View Model property).
public GetModelTypeFromSemanticMapping ( Type baseModelType ) : Type
baseModelType System.Type The base type as obtained from the View Model.
return System.Type

GetSemanticTypeNames() public method

Gets semantic type names (qualified with Vocabulary ID) for the Schema.
public GetSemanticTypeNames ( ) : string[]
return string[]

Initialize() public method

Initializes an existing instance.
public Initialize ( Sdl.Web.Common.Configuration.Localization localization ) : void
localization Sdl.Web.Common.Configuration.Localization The context Localization.
return void

ToString() public method

Provides a string representation of the object.
public ToString ( ) : string
return string