Creating a LINQ data access layer
In preparation for writing our first plugin in the next recipe, we will start in this recipe by creating a simple data access layer. A sample functional requirement states that; any e-mails associated with a specific account with no subject are to be closed, and the rest are to have an updated due date ten days from today's date when an account name is changed. In this recipe, we will only focus on retrieving the e-mails associated with a specific record, closing e-mails as canceled, and updating the rest.
This recipe will also leverage the unit of work pattern provided with the organization service context generated with the early bound entity generation. The patterns is explained in the How it works... section.
Getting ready
To write your data access layer, you will need the early bound entities generated as per the Creating early bound entity classes recipe from Chapter 3, SDK Enterprise Capabilities; optionally, you can generate the enums for the status...