Book Image

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By : Mike Liu
Book Image

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By: Mike Liu

Overview of this book

Table of Contents (20 chapters)
WCF Multi-layer Services Development with Entity Framework Fourth Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Hosting the HelloWorld WCF Service
Index

Adding a business logic layer


Until now, the WCF service contained only one layer. In this section, we will add a business logic layer and define some business rules in this layer.

Adding the business domain object project

Before we add the business logic layer, we need to add a project for the business domain objects. The business domain object project will hold definitions such as products, customers, and orders. These domain objects will be used across the business logic layer, the data access layer, and the service layer. They will be very similar to the data contracts that we defined in the previous section but will not be seen outside the service. The product business domain object will have the same properties as the product's contract data, plus some extra properties such as UnitsInStock and ReorderLevel. These properties will be used internally and shared by all the layers of the service. For example, when an order is placed, UnitsInStock should be updated as well. Also, if the updated...