entity framework - Lead to order relationship code first -


Hello I'm trying to install the first code in the unit framework 6 and wondering how I would do the following I am / P>

I have a lead class and a order class. The order class should have lead , but leads can be made without any orders and no one is associated with it The user can leave before making an order.

So my class structures are as follows:

  Public Leads {Public Ent ID (Receive); Set; } ... other non-related properties} public order {public diagnosis id (get; set;} public int LeadID {get; set}} public virtual lead lead {get; set;} ... other non-related properties }  

and I tried to link them using OrderConfiguration ()

 . HASRQUIRED (O = & Gt; o.lad)  

but it is looking like something like WithOptional or without ... HasForeignKey Instead of

What is a way to link to these, so that leads auto order leads class order Without the need, code>

You have to set the attribute for the forgin key that must be seen

  [key] public int id {get; set;} [foreign ("lead")] public at lead id {receive; set;}  

and Also set the

key in the Lead class


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -