If you are using the first code approach in the Entity Framework, here's how to map an EF object to a table from another database:
The SQL Script that must be run in your database to create a synonym for a table from another database:
CREATE SYNONYM OtherDatabaseTableSynonym FOR otherdatabase.dbo.otherdatabasetable
Display Entity Structure in (Fluent API):
modelBuilder.Entity<OtherDatabaseTableEntity>().ToTable("OtherDatabaseTableSynonym").HasKey(x => x.id);
source share