I have an Asp.Net MVC
application built with .Net 4.0
and EF6
. To improve performance of the application, I came across various posts and got to know that we must have compiled queries to drastically increase the performance of the application.
So I went on searching for compiled query
and wrote my own as below:
public static Func<KEEntities, IQueryable<tblProperty>> GetProperties =
CompiledQuery.Compile((KEEntities db) =>
from property in db.tblProperties select property);
But that query above gives me an error saying Error There is no implicit reference conversion from 'KEApplication.Models.EntityModel.KEEntities' to 'System.Data.Entity.Core.Objects.ObjectContext'.
Again after going through few posts and especially This
, by reading the answer
there, I was disappointed to know that the compiled queries
wasn't supported in .Net 4
and EF6
. I also read that EF
version > 4 provided automatic compilation of queries, but in my case I am not seeing any improvements, if it happened to. Are there any other possible ways to achieve functionality like compiled query
for the above configurations?