PacktLib: WCF 4.0 Multi-tier Services Development with LINQ to Entities

WCF 4.0 Multi-tier Services Development with LINQ to Entities


About the Author

About the Reviewers


Introducing Web Services and Windows Communication Foundation

What is SOA?

Web services

Web services: standards and specifications

WCF: Windows Communication Foundation

What is WCF?

Why is WCF used for SOA?

WCF architecture

Basic WCF concepts—WCF ABCs

WCF production and development environments


Implementing a Basic HelloWorld WCF Service

Creating the HelloWorld solution and project

Creating the HelloWorldService service contract interface

Implementing the HelloWorldService service contract

Hosting the WCF service in ASP.NET Development Server

Creating a client to consume the WCF service


Hosting and Debugging the HelloWorld WCF Service

Hosting the HelloWorld WCF service

Debugging the HelloWorld WCF service


Implementing a WCF Service in the Real World

Why layer a service?

Creating a new solution and project using WCF templates

Creating the service interface layer

Adding a business logic layer


Adding Database Support and Exception Handling to the RealNorthwind WCF Service

Adding a data access layer

Adding error handling to the service


LINQ—Language Integrated Query

What is LINQ

Creating the test solution and project

New data type var

Automatic properties

Object initializer

Collection initializer

Anonymous types

Extension methods

Lambda expressions

Built-in LINQ extension methods and method syntax

LINQ query syntax and query expression

Built-in LINQ operators


LINQ to Entities: Basic Concepts and Features

ORM—Object-Relational Mapping

Entity Framework

LINQ to Entities

Comparing LINQ to Entities with LINQ to Objects

Comparing LINQ to SQL with LINQ to Entities

Creating a LINQ to Entities test application

Creating the Data Model

Querying and updating the database with a table

View Generated SQL statements

Deferred execution

Deferred (lazy) loading versus eager loading

Joining two tables

Querying a view


LINQ to Entities: Advanced Concepts and Features

Calling a stored procedure

Compiled query

Direct SQL

Dynamic query


Handling simultaneous (concurrent) updates

Transaction support

Adding validations to entity classes

Debugging LINQ to Entities programs


Applying LINQ to Entities to a WCF Service

Creating the LINQNorthwind solution

Modeling the Northwind database

Copying the connection string to the service layer

Using LINQ to Entities in the data access layer

Adding concurrency support

Testing concurrency with WCF Test Client

Testing concurrency with our own client


Distributed Transaction Support of WCF

Creating the DistNorthwind solution

Hosting the WCF service in IIS

Testing the transaction behavior of the WCF service

Enabling distributed transaction support

Understanding the distributed transaction support of a WCF service

Testing the distributed transaction support of the WCF service