I have an entity ex: A and it has a related "X_Message" entity for which X_MessageSet is created in the ServiceContext class created by crmsvcutil tool.
When I use this I get error "the specified type X_message is not a known entity type" and this exception happens in LINQ code.
This is happening in our ServiceContext class which is XRMServiceContext.
Class which we are using to create instance of Context:
public CrmServiceProxy(IOrganizationService orgService)
{
_orgService = orgService;
context = new XrmServiceContext(this._orgService);
}
public System.Linq.IQueryable<XXX.X_message> X_messageSet
{
get
{
return this.CreateQuery<XXX.X_message>();
}
}
When I debugging my Plugin, I am seeing that "context" is having this X_messageset as a property but its giving System.ArgumentException, so am unable to debug too.
Please help.