简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM