sql - Junction Tables: Changing many-to-many to one-to-many in Entity Framework model -


i've got set of tables below:

positionshiftpattern
positionshiftpatternid
positionid

employeepositionshiftpattern
employeepositionshiftpatternid
employeepositionid

templateshiftpattern
templateshiftpatternid

week
weekid

positionshiftpatternjunction
positionshiftpatternid
weekid

employeepositionshiftpatternjunction
employeepositionshiftpatternid
weekid

templateshiftpatternjunction
templateshiftpatternid
weekid

so positionshiftpattern, employeepositionshiftpattern , templateshiftpattern each have junction week, one-to-many relationships inbetween.

obviously ef map relationships between positionshiftpattern, employeepositionshiftpattern , templateshiftpattern , week many-to-many , create navigation properties each table directly week.

is possible change many-to-many relationships one-to-many relationships (e.g. each week should map single shiftpattern)? i'm trying achieve mutual exclusion (see diagram below) , want avoid adding positionshiftpatternid, employeepositionshiftpatternid , templateshiftpatternid week. should looking @ way of achieving mutual exclusion?

mutual exclusion

thanks

no not possible. relation must same in database. if create one-to-many relation considered new 1 , have add ids week. when looking @ model doesn't make sense introduce such relation. @ moment shift can related many weeks , week can have many shifts. if introduce one-to-many mean each week instance can have 1 shift.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -