this.ContentProvider.GetEntityModel("XXX" + "-" + "###", WebRequestContext.Localization);

Using the GetEntityModel i am reading the component based on different criteria now i need to read the metadata of a component created using embedded schema.I had no issue in reading the plan text filed by just created the property in the model got the value but for embedded values am facing this issue.I have created a separate model for embedded schema but no luck .

 Public GeneralMetadata generalMeta { get; set; }

[SemanticEntity(Vocab = SchemaOrgVocabulary, EntityName = "GeneralMetadata", Prefix = "md", Public = true)]
    public class GeneralMetadata : EntityModel
        public DateTime publishDate { get; set; }

        public string shortTitle { get; set; }

Any help would be highly appreciated


There is a Known Issue with semantic mapping for embedded fields using explicit semantic mapping. Try using implicit mapping (without SemanticEntity or SemanticProperty attributes).

See, for example: https://github.com/sdl/dxa-web-application-dotnet/blob/release/1.5/Sdl.Web.Common/Models/Entity/Paragraph.cs

Your Answer

