Search code examples
c#entity-frameworkdynamic-data

How to use strings from Resources.resx file in dynamic data TableName attribute


Hi i am trying to find solution for using resource file with dynamic data based on EF 4.0

[TableName(Resources.Test)]
    public class TestTable
....

I get an error An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type.

How to do it right way?


Solution

  • Developer Art is right it is not supported.

    The problem is what is set at compile time and what is set at run time. The Attribute is a compile time attribute. You can therefore not change the value at runtime.