Saturday, 15 March 2014

c# - EF Many to many relationship with additional properties -


I know that this is a repeated question and I know that if there are additional properties in it, then it is not possible "Table".

I had an idea of ​​how to get the effect of the relationship rather than 1: nn-1, but I want to hear some other ideas.

If I have There are three institutions, A, B, and AB, where AB has made A: B relation possible and has additional properties.

From the database By using the Hale approach, I have a partial class A and B.

  Public Partial Class A {Public INMMerable & lt; EntityObject & gt; BS {Get it Back. P = & gt; PAB.B);} Set {// ...}}}   

Something like this might be possible

Just doodling in my head I'm currently on vacation and I do not have any computer, so it has not been tested, but my cell phone is written on.

I see It may be a problem after the reference settlement or separation is being done.

Any thoughts?

If you are already treating AB with a specific unit, then all the B All you need is something to get from:

  Public partial class A {public IQueryable & lt; B & gt; Get back to BS {get}. AB Enqual (). Select (AB = & gt; BB). Distinction (); }}}   

I'm not sure how well it will perform compared to many of the many supported people supported by EF (without any payload), but what you ask Are there.

No comments:

Post a Comment