I've got a object (Filter) that's defined something like this
public class Filter
{
public int FilterId { get; set; }
public string Name { get; set; }
public IList<User> Users { get; set; }
}
If possible, I'd like to store the object in multiple tables (sometimes spanning multiple rows)
Given an initialization of the Filter like this:
Filter myFilter = new Filter();
myFilter.FilterId = 1;
myFilter.Name = "Name of my filter";
myFilter.Users.Add(new User("Joe", 10));
myFilter.Users.Add(new User("Jim", 20));
..I'd like it to be persisted in tables "Filter" and "Filter_User"
Filter would end up with:
1 Name of my Filter
Filter_User would contain
1 10 (ref. to Joe's ID) 1 20 (ref. to Jim's ID)
I've been looking at the documentation and all I can find is using the element in my mapping file. But as far as I can tell it will only let me do that with a component-relationship (i.e. Employee and EmployeeDetails - 1:1)
Anyone to point me in the right direction?