score:8
Accepted answer
it looks like you are joining data from two different contexts: tms and entities.
this is not possible in linq as both have their own connection to the database and a completely separate model.
it's not possible for ef to convert this into a sql statement. (for all it knows, the tables might live in a different database)
you'd need to either move all your entities to a single context or execute both queries separately and then join them in memory. (use the first option if all tables are in the same db, use the second if you have separate databases)
Source: stackoverflow.com
Related Query
- What is meant by 'The specified LINQ expression contains references to queries that are associated with different contexts'
- The specified LINQ expression contains references to queries that are associated with different contexts error in c#
- Linq Lambda Error : The specified LINQ expression contains references to queries that are associated with different contexts
- Error: the specified linq expression contains references to queries that are associated with different context
- Error: "The specified LINQ expression contains references to queries that are associated with different contexts"
- The LINQ expression contains references to queries that are associated with different contexts
- Union two models together causes "The specified LINQ expression contains references to queries that are associated with different contexts."
- LINQ expression that contains references to queries that are associated with different contexts
- Error LINQ expression contains references to queries that are associated with different contexts
- What is the Efficiency and Performance of LINQ and Lambda Expression in .Net?
- What is the equivalent of XML PATH and Stuff in Linq lambda expression (GROUP_CONCAT/STRING_AGG)?
- What is the best way to create strongly typed LINQ queries from some given strings, via reflection
- What is the difference between these LINQ queries
- The parameter '***' was not bound in the specified LINQ to Entities query expression
- what is the Linq expression tree for setting a property of an object?
- The parameter 'd' was not bound in the specified LINQ to Entities query expression
- What is the max LINQ Expression Trees can do?
- What is the recommended practice for sharing similar linq to entities expression logic in different repositories
- What is the proper Linq expression for this left-outer-join query?
- To determine if one of the Strings from a list contains the initial part of a specified string using LINQ
- code first approach error: the specified type member 'yyyxx' is not supported in linq to entities
- What is the equivalent LINQ to SQL query expression of this SQL statement?
- What should be the right practice to handle duplicate linq queries to Database?
- NHibernate Linq with subquery returns 'Only one expression can be specified in the select list when the subquery is not introduced with EXISTS'
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- The source contains no DataRows using Linq
- Looping LINQ queries on the same IEnumerable - what am I missing?
- What SQL query or LINQ code would get the following data?
- The parameter 'p' was not bound in the specified LINQ to Entities query expression
- Get next element from Query after element with specified Id. The LINQ expression could not be translated
More Query from same tag
- Programmatically create a predicate for ordering an IQueryable
- Is LINQ to SQL the best way to build a Model or create my own classes
- List.Cast<> error "is a method which is not valid in the given context"
- order by List of Guids position
- Combine results after join and groupby with DataTable and List<Object>
- LINQ - Joins in a dynamic query
- How to use TryCatch Statement in ToDictionary C#?
- LINQ IEnumerable<T> Memory Structure
- LinqToExcel dot in header
- how to specify literal value in linq union
- How to handle no results in LINQ?
- Get Obsolete attribute using Linq
- How to go through 2 vectors in paralle using the same linq statement
- Different results between yield return and LINQ Select
- How to convert anonymous type to IListSource, IEnumerable, or IDataSource
- Query to extract data based upon time stamp conditions
- nhibernate queryover.where Object reference not set to an instance of an object
- Declare variable in LinQ expression tree
- Improve Performance of Generating List
- C# how to return multiple query in foreach
- Match the condition of the first array to be contains with second array
- Linq query from 3 tables using Joiner table
- How to get EF6 to generate efficient in(...) queries
- Adding new column and set value from others column in datagridview
- generating xml from object tree issue
- How to convert the below 2 foreach nested loops to linq query?
- Filter data from a virtual foreign key on an SQL query
- Slow performance on LINQ query against SQL server
- Self referencing LINQ
- Getting 2 Top 5 within a single LINQ query in EFCore