我想解决Azure表存储中的问题截至2014年3月,目前无法使用Count。因此,我读到将“添加选择”添加到获取所有项目将加快查询速度。所以,我想拦截我的存储库层中的链,并将Linq Lambda表达式添加到传入表达式中:
public int Count(Expression<Func<TDomainObject, bool>> filter)
{
//here I want to append a Select expression to the filter. How to do that
return GetBaseQuery(filter, null).Count(); //it will call TableStorage class
}
我尝试过这样的事情,但是错了。
Expression<Func<TDomainObject, bool>> selectPartitionKey = Expression.Lambda(Select(x=>x)); //Error cant resolve Select
Expression<Func<TDomainObject, bool>> newQuery =
filter.AndAlso(filter,selectPartitionKey//Error: Cannot convert binary expression to Expression<Func<TDomainObject, bool>> type
有什么想法吗?
由于