I'm working on a simple ORM library, quite simple in fact...
I have a query of type T
public IEnumerable<T> Query<T>(string query)
The method takes the T class, it gets the properties, loops through them and sets them accordingly
aProperty.SetValue(tmpGenericObjectOfTypeT, newValue, null);
My problem is that SetValue is incredibly slow, I saw two alternatives, using Reflection.Emit, or using delegates, unfortunately I have no idea how to do any of those.
As I've read, using delegates is a bit more elegant, and I'd like that solution, but I don't really know how to do it, I've searched and found a lot on how to call methods using Delegates, but not how to set properties...