I have a DataModel that contains a Hour table and a HourService that contains the pregenerated CRUD methods.
I have modified the GetHours() to this:
public IQueryable GetHours()
return from hours in this.Context.Hours
select new Hour()
HourID = hours.HourID
The reason why I construct a new Hour and set the properties manually is that I have some custom properties defined in a shared.cs file that I'm going to set manually.
This code compiles fine but in runtime I get the following error:
"Explicit construction of entity type 'DataModel.Hour' in query is not allowed."
Any help is appreciated!