Hey!
I have these two persistent classes:
Code:
public class Item{
public virtual Int32 {get;set;}
...
}
public class ItemUpdate{
public virtual Item Item {get; set;}
public virtual DateTime Updated {get; set;}
...
}
The ItemUpdate table in the db has a foreign key to Item, so I can have many updates for a particular Item... I COULD map this relationship with a set or a bag or else... but this list isn't needed but for audits.
Only the last update is significant, so, rather than this:
Code:
public class Item{
public virtual Int32 {get;set;}
public virtual IList<ItemUpdate> ItemUpdates;
...
}
I need something like this:
Code:
public class Item{
public virtual Int32 {get;set;}
public virtual ItemUpdate LastUpdate {get;set;}
...
}
Is it possible to map this kind of stuff? Thanks in advance!