Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity Framework Code First with SQL Server Synonyms
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    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.
    1. COYou won't be able to create a foreign key between databases, whether you are using a synonym or not, so I don't believe they could "do the job." See: http://stackoverflow.com/questions/1424327/foreign-keys-on-table-from-different-database If you don't need an explicit foreign key relationship, then can't you just join the local table to `centraldatabase.dbo.table` instead of creating synonyms to it all over the place? Or does EF not let you join across databases at all?
      singulars
    2. COI didn't realise you can join directly between two databases without a synonym - I've never had the need to before but that is useful. A fair point about not being able to use foreign keys, I guess this would never work - but even without an explicit relationship it still might be a way forward if I could get EF to support this. As far as I can tell, code first EF only supports a single database connection, and referencing a synonym as a table doesn't work.
      singulars
    3. COFrom what I can tell, this is not the last EF/CF limitation you'll come across if your project does not fit into the strict parameters of that model. Is EF/CF something you have to use, or are you using it because it's "all the rage"? I suspect if you want to do anything moderately complex you'll quickly get frustrated with all of its boundaries and seek other alternatives.
      singulars
 

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