I'm creating a delegate to retrieve all album records in the database. I've used this same way in another project, but for some reason I'm getting an error this time.
Have I missed a step? I'm not sure why this error is appearing.
Code
public static readonly Func<CodySolutionEntities, IQueryable<Album>> SelectAlbums =
CompiledQuery.Compile<CodySolutionEntities, IQueryable<Album>>(
query => from q in query.Albums.Include("Photo")
select q);
Error
Error 1 The type 'CodyData.Diagram.CodySolutionEntities' cannot be used as type parameter 'TArg0' in the generic type or method 'System.Data.Objects.CompiledQuery.Compile<TArg0,TResult>(System.Linq.Expressions.Expression<System.Func<TArg0,TResult>>)'. There is no implicit reference conversion from 'CodyData.Diagram.CodySolutionEntities' to 'System.Data.Objects.ObjectContext'. C:\Users\Cody\Documents\CMBS\CodySolution\CodyData\Delegates\PhotoDelegates.cs 13 13 CodyData
DbContext
to do what I'm trying to do, then? – Thickness