How it works...

In step 1 to step 16, we extracted all the methods related to the DAL into their own hierarchy. We started in step 1 to step 9 by creating a base concrete class along with its interface to give us basic reusable DAL methods, such as UpdateEntity (a polymorphic method that accepts any entity) and Commit. The base class's constructor instantiates the organization service context as it uses the unit of the work design pattern (as described in the Creating a LINQ data access layer recipe of Chapter 4, Server-Side Extensions). In step 10 to step 16, we created our e-mail-specific concrete DAL along with its interface. The concrete class inherits from the base class, thus including the accessible base class's methods.

From step ...

Get Microsoft Dynamics 365 Extensions Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.