Hi, say i have the following classes:
public class Article {
public virtual int Id { get; set; }
public virtual string Title { get; set; }
public virtual string Content { get; set; }
}
public class Meta {
public virtual string Description { get; set; }
public virtual string KeyWords { get; set; }
}
Where Meta would normally be mapped as a component (or a one to one
relationship) property on the Article class. However in the
application i'm building an admin can enable/disable the components
that apply to articles. Therefore i can't add a property against the
Article class as it won't always apply.
Now ideally in my code i'd like to be able to say:
var articles = session.Query<Article>().Where(a =>
a.Component<Meta>().KeyWords.Contains("Some Word"));
Is it possible to map the Component<T> method so that it maps as one
to one relationship table to get the Meta. Here's the database
structure i'd like to have:
Articles
- Id
- Title
- Content
Meta
- ArticleId
- Description
- Keywords
I'd appreciate it if someone could let me know if this can be done.
Thanks
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.