c# - Entity-Framework: Sort on Many-to-Many -


i have 2 entities many-to-many relationship , i'm looking way able sort result tables.
in other words, when row table1 , corresponding records table2 want able have stored sort order table2 that's specific row in table1.

my first thought add sort column table represents relation, knowledge there no way of accessing new column in relation.

does have suggestions on how accomplish this?

as ladislav mrnka states, if add new column junction table, there new entity "in middle" make navigation harder.

if want avoid this, still able make navigation usual, can keep junction table , add new table, junction, order column added. when need order info, can join table , use it.

this new table will, of course, require maintenance. i.e. can create delete on cascade junction+order junction table. , use trigger (ooops, that's not good!) create new row default order each new created relation. so, more advisable handle in business logic.

i know it's tricky, there's no magic solution... choose more comfortable you.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -