The bets solution is to have one DbContext with the two entities with. This way EF can easily join between them. You can create 2 more, distinct entities with just the fields you want. If your concerned about maintaining duplicative types, consider creating interfaces between them (SOLID's interface segregation principal). This way if you alter a property of field, do it first via the interface and it will force you to correct the duplicative types.
Assuming you cannot alter your existing ApplicationDbContext & OtherDbContext, you can create a third DbContext and 2 duplicative models this way:
interface IEmployee { string Name { get; } string Address { get; } }
interface IOtherTable { IEnumerable Others { get; } }
public class Employee : IEmployee { /* your existing class that may have more field*/ }
public class OtherTable : IOtherTable { /* your existing class that may have other fiels*/ }
public class Employee2 : IEmployee { /* Making this a subclass in a controller or something is preferred */ }
public class OtherTable2 : IOtherTable { /* Making this a subclass in a controller or something is preferred */ }
public sealed class CombinedDbContext {
public DbSet<Employee2> { get; set; }
public DbSet<OtherTable2> { get; set; }
}
Now you can do this safely and without hacky code...
var con = new CombinedDbContext();
var employee = con.Employee;
var otherTable = con.OtherTable;
var returnValue = (from e in employee
join o in otherTable on e.Id equals o.Id
select new
{
e.Name,
e.Address,
o.Others
});