lundi 18 juin 2018

c# FastMember how to check if field name is correct

I need to get field value from class by name. Reflection is slow so i found FastMember what are you think about it?

And my main question: I have this code:

ObjectAccessor accessor = ObjectAccessor.Create(item);
string fieldDbName = dataType.Name.Replace("REFERENCE_ORDER_", "");
object fieldValue = accessor[fieldDbName];

How can I check if fieldDbName exists in accessor?





Aucun commentaire:

Enregistrer un commentaire