Late bound classes

In the late bound programming method, we use the Entity class to refer to OOB and custom entities. Using late bound classes, we can refer to entities and attributes that may not exist during compile time. The late bound class method performs type checking at runtime. While using a late bound class, we will not get any type of intelliSense support, so we need to make sure to reference the correct field entity and attribute names. In the late bound method we use logical attribute names instead of schema names. The following code snippet is an example of creating a contact using a late bound class:

Entity _Contact=new Entity("contact");
_Contact["firstname"]="Mahender";
_Contact["lastname"]="Pal";
Guid _ContactId=_service.Create(_Contact);

Late bound classes help us to write code for those entities that are not yet created and they also use fewer resources as compared to early bound classes. But, they do not provide any intelliSense support, so we need to know the exact logical name of the entity and attributes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.116.51