Microsoft Dynamics CRM 2011. Generic method to get entity by ID -


in crm 4.0 had generic method in repository:

public t getentitybyid(guid id) {     var entities =         e in m_context.getentities(typeof (t).name)         e.getpropertyvalue<guid>(identityfieldname) == id         select e;     return (t) entities.firstordefault(); } 

but crm 2011? icrmentity getpropertyvalue method missed...

what alternate generic entity id?

something (t) m_context.retrieve(typeof (t).name, id, new columnset()).
see here


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -