title: dynamically set value to the parameter of function attribute in C#
body: <p>I am facing problem while getting data list from data base using Linq DataContext</p>
  
  <p>I am trying following code</p>
  
  <blockquote>
    <p>public class DBContextNew : DataContext
        {</p>
  
  <pre><code>    public static string StoreProcedureName = "";
  
      [Function(Name = StoreProcedureName, IsComposable = false)]
      public ISingleResult&lt;T&gt; getCustomerAll()
      {
  
          IExecuteResult objResult =
            this.ExecuteMethodCall(this, (MethodInfo)(MethodInfo.GetCurrentMethod()));
  
          ISingleResult&lt;T&gt; objresults =
              (ISingleResult&lt;T&gt;)objResult.ReturnValue;
          return objresults;
      }
  
  
  }
  </code></pre>
  </blockquote>
  
  <p>but am getting error for </p>
  
  <blockquote>
    <p>[Function(Name = StoreProcedureName, IsComposable = false)]</p>
    
    <p>as An attribute argument must be a constant expression, typeof
    expression or array creation expression of an attribute parameter type</p>
  </blockquote>
  
  <p>I wanted to pass value to Name attribute at run time.</p>
  
  <p>Is it possible?</p>
  
  <p>Please help.</p>