Closed zaha closed 4 years ago
State Codes are generated in the Entity classes, and they're just postfixed with State. Sure you aren't getting confused? Also those entities are weird custom entities that truly don't have values:
I see. I'm rolling my own entity classes as I do not want any dependency on the CRM SDK, so I only use the OptionSets from the EBG. Is there a reason why the status codes are part of the OptionSet export but the state codes aren't?
Would be really handy for me, but I understand that this might be an odd use case.
It's something that the CrmSvcUtil has always generated it as. Why are you rolling your own entities? Maybe the new .core sdk would be helpful?
I'm rolling my own entities for mainly two reasons:
Thanks for sharing the info about the .NET Core SDK. That would actually help me quite a lot with the second reason, since I have to use a Web API C# library right now that's not well maintained. But since it's still in early alpha I have to wait for a production-ready release.
That won't help, however, when using the enums in my SDK-independent DTOs. Guess I will have to take care of the state codes myself then. At least I can generate all the other option set enums, that already helps a lot.
Thanks for your support in any case!
I think it might makes sense to have an option to generate EarlyBound without any dependency on the Xrm Entity... I'll have to talk to Microsoft about that as well.
Now THAT would be awesome!
Would it need to have it's own Entity base class defined, or would you just want POCO (so no Attributes Collection, formatted values, etc)
I'm using an entity base class with an attributes collection since that allows for delta updates of only the changed attributes in my API. My derived entities provide properties for ease-of-access to these attributes in the collection, so pretty much what the generated early bound entities do from CrmSvcUtil, just without the dependency on Xrm.Entity
.
For JSON serialization I marked only the ID, EntityLogicalName and Attributes collection properties as [DataMember]
so the serializer ignores the redundant properties. Having only the redundant properties instead of the attribute collection in the JSON would produce nicer JSON, but I couldn't think of a way to do delta updates then as I can't differentiate between an attribute being set to null and not being set.
I'm going to close this issue, since the issue itself has been resolved.
Hi,
I just noticed that the StateCode option sets are missing for all entites except the following 4:
But when looking at them, all are empty:
except for OpportunityClose_OpportunityStateCode:
Is there something wrong with my settings?