After generating early bound classes using crmsvcutil.exe I'm having an issue with entity fields that are OptionSet values. The generator is generating the attributes as type "Object" instead of Microsoft.Xrm.Sdk.OptionSetValue.
Example: for CustomerTypeCode field on the contact entity, the attribute is generated as:
public Object CustomerTypeCode
{
get
{
return this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("customertypecode");
}
set
{
this.OnPropertyChanging("CustomerTypeCode");
this.SetAttributeValue("customertypecode", value);
this.OnPropertyChanged("CustomerTypeCode");
}
}
INSTEAD OF
public Microsoft.Xrm.Sdk.OptionSetValue CustomerTypeCode
......
I validated the difference by looking at a the classes generated in an older project (pre-CRM 2016).
It is creating a problem in that I can no longer use a linq query to retrieve contacts with a specific CustomerTypeCode value.
Is there a command line option I'm missing for crmsvcutil.exe?
or has the logic changed and I should be using the attribute differently?
Thanks in advance.