我試着寫符合查詢,如下所示:得到錯誤而寫遵守LINQ查詢
public static Func<MyDBEntities, string, List<Client>> getCustomers =
CompiledQuery.Compile(
(MyDBEntities ctx, string strCustCode) => from objCustomer in ctx.Clients
select objCustomer);
,並得到以下錯誤消息:
Creates a new delegate that represent the complied LINQ to Entity query
Error:
There is no implicit reference conversion from MyDBEntities to System.Data.Objects.ObjectsContext
我在這個項目中使用的DbContext。
不明白錯過了什麼。
感謝