« Creating Customer Relationships From the Grid | Main | Implementing Field Level Security in CRM 4.0 - Options and Constraints »

November 07, 2009

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54fb34b6f88330120a66051cb970b

Listed below are links to weblogs that reference Dynamic Entity Helpers Using Extension Methods:

Comments

Vlad

Here is my samples (based on KeyProperty):

public static KeyProperty Key(this DynamicEntity dynamicEntity)
{
foreach (Property prop in dynamicEntity.Properties)
{
if (prop is KeyProperty)
{
return prop as KeyProperty;
}
}

throw new KeyNotFoundException("В коллекции свойств сущности нет свойства типа KeyProperty");
}

Also I use similar approach for Lookup fields:

public static BusinessEntity Entity(this Lookup lookup, string typeName)
{
return _service.Retrieve(
(lookup.type ?? typeName),
lookup.Value,
new AllColumns());
}

Note, you must pass the type of Lookup field, since "type" field often is null...

8gb usb drive

The obvious type would be AttributeCollection but would move unnecessary casting in some of the other extension methods. The types will be MetaTable for the table permissions extension method and MetaColumn for the others and any casting will then be hidden in the extension methods themselves.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.

Search The Blog

  • Search the Blog
     

    WWW
    this blog

Twitter Updates

    follow me on Twitter