Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Microsoft Dynamics 365 Extensions Cookbook

You're reading from  Microsoft Dynamics 365 Extensions Cookbook

Product type Book
Published in Jun 2017
Publisher Packt
ISBN-13 9781786464170
Pages 462 pages
Edition 1st Edition
Languages

Table of Contents (19) Chapters

Title Page
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. No Code Extensions 2. Client-Side Extensions 3. SDK Enterprise Capabilities 4. Server-Side Extensions 5. External Integration 6. Enhancing Your Code 7. Security 8. DevOps 9. Dynamics 365 Extensions 10. Architectural Views 11. Dynamics 365

Replacing your LINQ data access layer with QueryExpressions


Given that we have refactored our plugin in the previous recipe, we will now demonstrate how easy it is to swap a concrete DAL class with an alternative implementation.

In this recipe, we will replace the LINQ EmailDataAccessLayer implementation with a QueryExpression implementation. We will also drop the unit of the work design pattern and use IOrganizationService instead of OrganisationServiceContext.

Getting ready

To implement this recipe, we will need the existing code structure from the previous recipe. If you are starting from scratch, you can follow the code structure from the previous recipe and replace the implementation with your own code.

As with any recipe that deals with C# code, it is strongly recommended that you use a stable version of Visual Studio. In our example, we will be using Visual Studio 2015.

How to do it...

  1. Create a new public class called EmailDataAccessLayerQueryExpression in the DataAccessLayer folder that...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}