パブリック変数compiledQuerywriteFunc < MYEntities 、string、???>をどのように挿入でき ますか
public var compiledQuery = CompiledQuery.Compile((AddresEntities ctx, string name) =>
from x in ctx.User
where x.Name.Contains(name)
select new { x.Name, x.Phone});
このように試してみると、エラーが発生します。 パラメーターの少ないコンストラクターのみがサポートされます
public static Func<AddresEntities, string, IQueryable<MYClass>> compiledQuery =
CompiledQuery.Compile((AddresEntities ctx, string name) =>
(from x in ctx.Users
where x.Name.Contains(name)
select new MYkontakt( x.Name, x.Phone)));