Linq DataContext を使用してデータベースからデータ リストを取得中に問題に直面しています
次のコードを試しています
public class DBContextNew : DataContext {
public static string StoreProcedureName = ""; [Function(Name = StoreProcedureName, IsComposable = false)] public ISingleResult<T> getCustomerAll() { IExecuteResult objResult = this.ExecuteMethodCall(this, (MethodInfo)(MethodInfo.GetCurrentMethod())); ISingleResult<T> objresults = (ISingleResult<T>)objResult.ReturnValue; return objresults; } }
しかし、エラーが発生しています
[関数 (名前 = StoreProcedureName、IsComposable = false)]
as 属性引数は、定数式、typeof 式、または属性パラメーター型の配列作成式でなければなりません
実行時に Name 属性に値を渡したいと思いました。
出来ますか?
助けてください。