{"action":"closed","issue":{"url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/143","labels_url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/143/comments","events_url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/143/events","html_url":"https://github.com/mikeedwards83/Glass.Mapper/issues/143","id":87202491,"number":143,"title":"Type inference on collections not working","user":{"login":"drachele","id":825135,"avatar_url":"https://avatars.githubusercontent.com/u/825135?v=3","gravatar_id":"","url":"https://api.github.com/users/drachele","html_url":"https://github.com/drachele","followers_url":"https://api.github.com/users/drachele/followers","following_url":"https://api.github.com/users/drachele/following{/other_user}","gists_url":"https://api.github.com/users/drachele/gists{/gist_id}","starred_url":"https://api.github.com/users/drachele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drachele/subscriptions","organizations_url":"https://api.github.com/users/drachele/orgs","repos_url":"https://api.github.com/users/drachele/repos","events_url":"https://api.github.com/users/drachele/events{/privacy}","received_events_url":"https://api.github.com/users/drachele/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-11T04:04:30Z","updated_at":"2015-06-11T06:48:08Z","closed_at":"2015-06-11T06:48:08Z","body":"I'm having some trouble with type inference on a collection with the latest Glass Mapper (4.0.1.5). When the collection is returned, all the objects in the list are of the base type rather than the actual type.\r\n\r\nThis is my model class:\r\n\r\n```\r\n[SitecoreType(TemplateId = Constants.Templates.IdStrings.Article, AutoMap = true)]\r\n    public class Article : ItemBase\r\n    {\r\n        public virtual string Title { get; set; }\r\n        public virtual string IntroCopy { get; set; }\r\n        public virtual Image HeaderImage { get; set; }\r\n        public virtual Image NextArticleImage { get; set; }\r\n        [SitecoreChildren(InferType = true)]\r\n        public virtual IEnumerable<ModuleBase> Modules { get; set; }\r\n        public virtual string ExcerptText { get; set; }\r\n        public virtual int ArticleNumber { get; set; } \r\n    }\r\n```\r\n\r\n`ModuleBase` has several inherited classes, all mapped in a similar way to templates in Sitecore.\r\n\r\nI have also set up the AttributeConfigurationLoader in GlassMapperScCustom:\r\n\r\n```\r\npublic static IConfigurationLoader[] GlassLoaders()\r\n{\t\t\r\n    var ezine = new AttributeConfigurationLoader(\"xxx.xxx.Core\");\r\n    return new IConfigurationLoader[] { ezine };\r\n}\r\n```\r\n\r\nI've added several different types of `ModuleBase` to an instance of an article in Sitecore but all the instances are returned by Glass as `ModuleBase`.\r\n\r\nI've even tried using interfaces on the collection definition but then I just get returned a list of proxied  objects.\r\n\r\nAm I missing something, or is this a bug?\r\n\r\nAny help would be greatly appreciated.\r\n\r\nThanks,\r\nDan."}}