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

Represents a Semantic Schema
Deserialized from JSON in schemas.json.
Afficher le fichier Open project: sdl/dxa-web-application-dotnet

Méthodes publiques

Méthode 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 méthode

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

GetEntityNames() public méthode

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
Résultat string>.ILookup

GetModelTypeFromSemanticMapping() public méthode

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.
Résultat System.Type

GetSemanticTypeNames() public méthode

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

Initialize() public méthode

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

ToString() public méthode

Provides a string representation of the object.
public ToString ( ) : string
Résultat string