Skip to content

Instantly share code, notes, and snippets.

View ErnestasJa's full-sized avatar

serengeor ErnestasJa

View GitHub Profile
@rally25rs
rally25rs / CodeSample1.cs
Created May 10, 2011 00:27
Code Sample 1 (DynamicMethods and ILEmit)
/* ***
* This is a method from an object-relation-mapping (ORM) tool that I had started to write.
* I eventually stopped working on it, ad instead contributed time to the open source
* SubSonic project instead.
*
* This method is an example of generating DynamicMethods to be used at runtime to check and
* set some properties any an arbitrary type. This was used over straight reflection every time
* because reflection can be fairly slow. The use of a DynamicMethod is much quicker.
* *** */