Extensions Methods on DynamicEntity

You know when you want to get in integer value on an entity say its called age. Current you have to check the property exists, if it does cast it to a CrmNumber then get the value. How many times do you copy and paste the same crappy code and then if you say hey that duplication i'll create a static method and do it that way. Its all dirty.

I have added heaps of extension methods to DynamicEntity so you dont have to. Example using the API is:

var contact = new DynamicEntity("contact");
int age = contact.GetIntegerValueFor("age");

Its all done now no more of that horrible boiler plate code.

There are also methods on the dynamic entity to make setting values simpler.

Extensions Methods on CrmService

 There are a couple of methods on the CrmService to make finding an object by identity,column name really easy. ie service.GetEntityByColumn("name","Fred Flintstone"); Is an example plus query methods etc.


Last edited Oct 1, 2010 at 7:53 AM by blairdavidson, version 3


No comments yet.