3
I have the following code snippet:
[Campo(Chave=true)]
public System.Guid EscalaId { get; set; }
I know I can read these tributes using class MemberInfo
, as it says example in the documentation:
System.Reflection.MemberInfo info = typeof(MyClass);
object[] attributes = info.GetCustomAttributes(true);
But there are alternatives without the use of reflection?
What is the purpose of this?
– Leonel Sanches da Silva
Essentially there is no way. There are even absurd forms.
– Maniero
Do reflection without reflection. To me it sounds kind of strange.
– Jéf Bueno
It is a part of a system, which relies on class attributes to mount SQL commands. I read that reflection can be slow compared to other tools, and as this feature of assembling queries is widely used, I decided to search to see if there was any alternative, as I found only examples with reflection, I decided to make a last attempt here
– Artur Trapp