The query contains references to items defined on a different data context

后端 未结 1 1764
清歌不尽
清歌不尽 2021-01-22 19:23

I read couple of another posts in Stackoverflow but my problem is simple and different. I have 2 separate databases and thats why I have two separate Datacontext. Here is my que

相关标签:
1条回答
  • 2021-01-22 20:09

    I don't believe you should be doing a join across two data contexts. From the look of your LINQ query, you're not even using r from your join query to produce anything meaningful; it looks like you can just query cv1 and get your data:

    var td = cv1.Entity_Product_Points.Where(x => x.Entity_ID == getEntity);
    // Call ToList to fully enumerate the set. 
    

    EDIT: Looking up a solution, it seems like it might be just as easy as marking each data context query AsQueryable to get the solution.

    0 讨论(0)
提交回复
热议问题