use decimal values as attribute params in c#?

前端 未结 5 1563
时光说笑
时光说笑 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:17

    When I have run into this situation, I ended up exposing the properties on the attribute as a Double, but inside the attribute treated them like Decimal. Far from perfect, but for the simple cases, it just might be what you need.

提交回复
热议问题