use decimal values as attribute params in c#?

前端 未结 5 1566
时光说笑
时光说笑 2020-11-30 02:52

I\'ve been trying to use decimal values as params for a field attribute but I get a compiler error.

I found this blog post link saying it wasn\'t possible in .NET to

5条回答
  •  天涯浪人
    2020-11-30 03:22

    You can use the following constructor. When you have a decimal literal in C# code, the C# compiler emits a call to this constructor.

    Decimal(Int32, Int32, Int32, Boolean, Byte)

    Edit: I know this is not convenient.

提交回复
热议问题