c# - Mapping a domain entity to multiple tables -


I have an object that has something defined

  Public Sector {Filter Public Ink Filter ID {get; Set; } Public string name {get; Set; } Public IList & lt; Users & gt; User {Received; Set; }}  

If possible, I would like to store the object in several tables (sometimes several rows are spread)

The initialization of the filter in this way Giving:

  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 ("gym", 20));  

.. I would like to retain it in the "Filter" and "Filter_user" table

ending with filter:

1 Name of my filter

In filter_USER

1 10 (Ref in ID) 1 20 (Ref in Jim ID)

I'm looking at the documentation And I think my mapping is using the element in the file. But as far as I can tell, it will allow me to do this with component-relation (i.e. employee and employee details - 1: 1)

Anyone to point me in the right direction

I think that you are just looking for many unions? You are not constrained using component relations.

Can you see many-to-many mapping types?

  & lt; Set name = "user" table = "filter_user" & gt; & Lt; Major column = "filterid" /> & Lt; Many-to-many columns = "user id" category = "user" /> & Lt; / Set & gt;  

Comments