tag:blogger.com,1999:blog-3002872373515344423.post2129264273568953454..comments2023-03-22T04:20:33.172-04:00Comments on Methodic Madness: Practical MongoDB Part 3: Fine TuningJPhttp://www.blogger.com/profile/15058146074302656751noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-3002872373515344423.post-20458290682188724072011-09-02T11:58:02.429-04:002011-09-02T11:58:02.429-04:00Hi Joel, thanks a lot for your examples. I do have...Hi Joel, thanks a lot for your examples. I do have a problem though that really looks like your UserStat class. Basically I have a class called Event which has a list of embedded Criterias, the class Criterias is an abstract class which may contain N types of criterias, so:<br />public abstract class Criteria<br />{<br /> public string Type {get;set;}<br />}<br />public class CriteriaA : Criteria<br />{<br /> public string Day {get;set;}<br />}<br />public class CriteriaB : Criteria<br />{<br /> public string Night{get;set;}<br />}<br /><br />The problem is that when querying Events (with a repository) I can't access the child properties that I need, say:<br />_repostory.Find(p=>p.Criterias.Any(x=>x.Type).FirstOrDefault()<br /><br />I can access the property "Type" bevause it belongs to the main abstract class, but how can I access the other child properties when needed?<br /><br />Thanks.Mau Sanchezhttps://www.blogger.com/profile/05040867711555513808noreply@blogger.com