Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet` 'Where' not found

asp.net-mvc-4 c# entity-framework linq

Question

this solution has 4 layers.

in the BLL there is Validation Method check the user input (Server Validation ) the Error happend here:

BLL.server

Entities dbo = new Entities { };
var query = from c in dbo.database1 where c.id == id select c.Name;

I reference

  • using System.Linq;
  • using System.Data.Linq;
  • using System.Data.Entity;

and other lower Project,

if there a good approach to make it right HINT me please.

1
2
4/17/2014 11:44:47 AM

Popular Answer

In your query you select from context.db.Name, whereas you should select from context.db, otherwise select c.Name would mean context.db.Name.Name

Entities dbo = new Entities();
var query = from c in dbo.database1 where c.id == id select c.Name;
2
4/17/2014 11:49:20 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow