The days of hearing ‘op-tion sets completed successfully’ have come to an end. With the release of version 2 of the Early Bound Generator, the creation of Dataverse models to use within your .NET projects now happens with the press of only a single button. Plus there is no longer the need to sign in three times!
Why Earlybound Models?
For those of us working on the backend of Microsoft Dynamics, the relationship with the Early Bound Generator in the Xrm Toolbox can be a complicated one. Never knowing if the most recent update will fix a previous issue or cause another one (tip: get another colleague to install the update before you do!).
However, the benefits of using it outweigh the occasional bugs, and I am always happy when I convince someone to start using it. One of the main reasons is that generating early bound models for Dynamics aids in creating code that is easy to update and easier to understand. Dataverse tables are translated into the .NET project in a simple and user-friendly way. Additionally, fields are typed, meaning less issues of having to guess what datatype you can push to dynamics.
Version 2.0 (or 2.2023.4.24)
The Early Bound Generator version 2, just like the first version, builds models for Dataverse tables. This includes optionsets and message classes (such actions, custom APIs). As a Dynamics environment grows, keeping models and optionsets up to date by hand can be a tedious task. In my opinion it is energy that can be better spent working on the logic within the code.
At Dynamic People I have worked on creating a template xml that can be used to generate these early bound models. The only part left for the developer or consultant is choosing the entities that need to be generated. The xml is then saved into the repository and can be part of source control.
The benefit is having a standardized way of accessing these models and being able to re-generate these models at the click of a button if an option is added in an optionset or fields are added. Enum generated properties of optionsets allow a developer to have a better view of the string and integer values of the optionset in the code, meaning no need to go back and forth in Dynamics to see what the correct value is—the Early Bound Generator has already generated it for you.
In conclusion, the new version of the Early Bound Generator allows for an even quicker turnaround in the creation of Dataverse models in .NET. Meaning you have more time to code!