Sometimes developers don't know whether they should use a Func<> or an Expression<Func<>> with the Entity Framework and LINQ. The distinction was critical in a situation I faced today.
Our application was having performance problems, and Red Gate's excellent ANTS profiling tool pointed to a method that, reduced to its essence, was like what you see below. Context is an Entity Framework context, and MyEntities is one of the entity tables in the context.
IEnumerable<MyEntity> LoadMyEntities(Expression<Func<MyEntity, bool>> predicate)
{
return Context.MyEntities.Where(predicate);
}
The idea is that a caller can pass in a predicate in the form of a Lambda. The compiler will turn the Lambda into...
Chủ Nhật, 29 tháng 5, 2016
Thứ Năm, 26 tháng 5, 2016
Handler "has a bad module "ManagedPipelineHandler" in its module "
Ran command:
Read More »
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
If I had been on a 32 bit system, it would have looked like the following:
%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i
Đăng ký:
Bài đăng (Atom)