Hi,
I have generated Xrm for my CRM instance , when i use the classes in it which represents schema names of an entities , exception occurs . For example, i have entity called "Class" and it's schema name is "new_class", when i create a query like this :
using (var orgService = crmConnection.GetContext()) { return (from i in orgService.CreateQuery<new_instructorplacement>() where i.Id == id select i).FirstOrDefault(); }
exception occurs : {"Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type 'new_instructorplacement'."}. Any one knows what might be the problem ?