I have installed the package Glass.Mapper.Sc.CastleWindsor
in version 3.1.2.11
on my Sitecore 7.1 solution and am trying to work with inferred types. I have the following classes:
[SitecoreType]
public class ServiceConfiguration
{
[SitecoreField(FieldName = "Service Id")]
public virtual string ServiceId { get; set; }
}
[SitecoreType(TemplateId = "{26512C19-8D30-4A1E-A2CD-3BA89AF70E71}")]
public class JavascriptServiceConfiguration : ServiceConfiguration
{
[SitecoreField(FieldName = "Is Header Responsive")]
public virtual bool IsHeaderResponsive { get; set; }
}
And i have this item:
In my code, I try to get this item from the current context mapped by glass with the following line of code:
var serviceConfig = (new SitecoreContext()).GetItem<ServiceConfiguration>("{5436EEC6-1A4D-455F-8EF7-975C51FAE649}", inferType: true);
According to the documentation on inferred types, I would expect that serviceConfig
would be of type JavascriptServiceConfiguration
, but it is of type ServiceConfiguration
. Am I missing something? I did not make some specific configuration to glass.