Is there a way to implement a custom query design for a Navigation property, preferably using Fluent API?
I have seen several implementations using the Query Projections design pattern, but failed to find any that implement it at the property level. Most seem to be used off the context object of the Entity and not much off the Mapping framework.
Ideally looking to do something like this:
public class ArticleContent : IArticleContent {
#region IArticleContent Members
public Guid ArticleId { get; set; }
public string Title { get; set; }
public DateTime Version { get; set; }
public Guid CreatedBy { get; set; }
//Navigation Properties
public User User { get; set; }
public Article Article { get; set; }
public ArticleContentRaw RawContent{get;set;}
#endregion
}
public class ArticleRepository: IArticleRepository {
public ArticleRepository(){
Entity.RawContent = Context.ArticleContentRaw.OrderByDesc(acr => acr.CreatedBy);
}
}
Although probably not syntactically correct but should get the idea acrossed.