The below code is not returning the children's,
var TemplateID = Guid.Parse("{51A26CD4-FCB5-4A3C-8720-2D60F625A678}");
var _Options = new GetItemByIdOptions(TemplateID)
{
InferType = true,
Lazy = Glass.Mapper.LazyLoading.Enabled
};
var target = context.SitecoreService.GetItem<IGlassModel>(_Options);
Below is the Model :
[SitecoreType(TemplateId = "{19CDADF8-D474-42C9-8C8D-522A7FF93663}", AutoMap=true)]
public class IGlassModel
{
Guid Id { get; set; }
string Path { get; set; }
//[SitecoreItem]
//string Name { get; set; }
[SitecoreChildren]
IEnumerable<Country> Chlidren { get; set; }
}
[SitecoreType(TemplateId = "{780F8593-3AFA-4DF0-98EE-16FFDD18F88F}", AutoMap = true)]
public class Country
{
Guid Id { get; set; }
string Path { get; set; }
[SitecoreItem]
string CountryName { get; set; }
[SitecoreItem]
string CountryCode { get; set; }
}
IGlassModel
?virtual
modifier forChildren