You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Mike,
I am using fluent mapping in my Sitecore project. I am using Sitecore 9.3 and Glass mapper 9.3 for my project.
I have created IGlassBase.cs for map standard template items. When I am trying to map Created and Updated Date using fluent mapping both are not working.
My IGlassBase.cs Class is as below:
I am to get Dispaly Name, URL etc but not able to map Created and Updated Date. It returning me DateTime.min. I have tried below option as well but not success:
Removed AutoMap ()
Put it before the AutoMap()
Please have a look and do the needful.
Thanks & Regards,
Himmat Singh Dulawat
The text was updated successfully, but these errors were encountered:
Hi Mike,
I am using fluent mapping in my Sitecore project. I am using Sitecore 9.3 and Glass mapper 9.3 for my project.
I have created IGlassBase.cs for map standard template items. When I am trying to map Created and Updated Date using fluent mapping both are not working.
My IGlassBase.cs Class is as below:
public interface IGlassBase
{
Guid Id { get; set; }
DateTime CreatedDate { get; set; }
DateTime UpdatedDate { get; set; }
string DisplayName { get; set; }
Language Language { get; set; }
int Version { get; set; }
string Name { get; set; }
string Path { get; set; }
string ContentPath { get; set; }
string FullPath { get; set; }
string Url { get; set; }
string PageUrl { get; set; }
string MediaUrl { get; set; }
IEnumerable BaseTemplateIds { get; set; }
string TemplateName { get; set; }
Guid TemplateId { get; set; }
IGlassBase Parent { get; set; }
IEnumerable Children { get; set; }
}
And I am mapping IGlassBase using Fluent as below:
public class GlassMappings : SitecoreGlassMap
{
public override void Configure()
{
Map(config =>
{
config.AutoMap();
config.Field(f => f.CreatedDate).FieldName("__created");
config.Field(f => f.UpdatedDate).FieldName("__Updated");
config.Info(f => f.DisplayName).InfoType(SitecoreInfoType.DisplayName);
config.Info(f => f.PageUrl).InfoType(SitecoreInfoType.Url).UrlOptions(SitecoreInfoUrlOptions.LanguageEmbeddingNever);
config.Info(f => f.MediaUrl).InfoType(SitecoreInfoType.MediaUrl).UrlOptions(SitecoreInfoMediaUrlOptions.LowercaseUrls);
config.Parent(f => f.Parent);
config.Children(f => f.Children);
});
}
}
I am to get Dispaly Name, URL etc but not able to map Created and Updated Date. It returning me DateTime.min. I have tried below option as well but not success:
Please have a look and do the needful.
Thanks & Regards,
Himmat Singh Dulawat
The text was updated successfully, but these errors were encountered: