Note that there are some explanatory texts on larger screens.

plurals
  1. POMap many to many relation in entity framework
    primarykey
    data
    text
    <p>I have a sql server database and a c# win forms application and I am using entity framework.</p> <p>In the database I have the following tables :</p> <pre><code>Table Joint( JointID FirstName FatherName LastName) </code></pre> <p>Which represent a joint in gym and every joint has a closet, and every joint has one closet and each closet can be rent by one joint. so i thought this one to one relation i don't know if it's true but anyway this the closet table :</p> <pre><code>Table Closet( ClosetID Number) </code></pre> <p>but at the same time i want to keep a history for each closet because maybe someone rent it for 2 months and then someone else rent the same closet after the first one so i want to know each joint rent this closet, and i want to know who is own know and how much he payed for the rent of the closet, so i want a start time, end time, price.</p> <p>at last i figured out that i want a third table between the above tables and it will be a many to many relation so i created :</p> <pre><code>Table ClosetHistory( JointID fk ClosetID fk StartTime EndTime Price) </code></pre> <p>and i think this right but i am not sure and this all not my problem. My problem is when i update my entities from database the relation between joint and closet not created and it create a joint entity stand alone and a closet entity but it doesn't contain a startTime, EndTime, Price attributes, and the ClosetHistory not created and that is true because the table between tow tables in many to many relation not represented as an entity, But if i remove the startdate and enddate, price fields from ClosetHistory table and re pdate my entities it works and the relation is created but then i can't save the starttime and endtime and price for the closets</p> <p>can you help me please ??</p> <p>and i am sorry for all this explanation, and i am sorry for my English language i know it's very bad :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload