Reputation: 1455
I have an object called "Comment" now a Comment can be associated with a "News" article OR a "Feature" article or a "Product". So will look something like:
public class Comment
{
[BelongsTo]
public Feature Feature
{get;set;}
[BelongsTo]
public News News
{get;set;}
[BelongsTo]
public Product Product
{get;set;}
}
Now obviously only 1 Feautre, Product, or News will be populated at a time, and all implement interface "IContent". So how do I get one property like:
[BelongsTo(Type = Change type at runtime!!)]
public IContent Content
{get;set;}
Any idea how to structure this?
Upvotes: 1
Views: 74