万本电子书0元读

万本电子书0元读

顶部广告

WCF 4.0 Multi-tier Services Development with LINQ to Entities电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Mike Liu

出  版  社:Packt Publishing

出版时间:2010-06-08

字       数:234.4万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
This book is a step-by-step tutorial to guide you through learning WCF and LINQ to Entities. You will be guided to create five WCF and LINQ solutions from scratch, of which three are multi-tiered real-world WCF service solutions, so you will not only be reading, but also be coding through the book, to gain practical experience of WCF and LINQ to Entities. Various test clients will be associated with each solution and these solutions can be built and run independently of other solutions. Clear step-by-step instructions and relevant screenshots will make sure you won't get lost in the new world of WCF and LINQ to Entities. Configuration files, host applications, test clients, and WCF services for each solution will also be available for download for you to examine, modify, and debug from the outside in. The book focuses on the essentials of using WCF and LINQ to Entities, rather than providing a reference to every single possibility. It leaves the reference material online where it belongs, and concentrates instead on practical examples, code, and advice. This book is for C# and C++ developers who are eager to get started with WCF and LINQ to Entities, and want a book that is practical and rich with examples from the very beginning. Developers and architects evaluating SOA implementation technologies for their company will find this book particularly useful because it gets you started with Microsoft's tools for SOA and shows you how to customize our examples for your prototypes. This book presumes basic knowledge of C# or C++. Previous experience with Visual Studio will be helpful but is not required, as detailed instructions are given throughout the book.
目录展开

WCF 4.0 Multi-tier Services Development with LINQ to Entities

Table of Contents

WCF 4.0 Multi-tier Services Development with LINQ to Entities

Credits

About the Author

About the Reviewers

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Errata

Piracy

Questions

1. Introducing Web Services and Windows Communication Foundation

What is SOA?

Web services

What is a web service?

Web service WSDL

Web service proxy

SOAP

Web services: standards and specifications

WS-I Profiles

WS-Addressing

WS-Security

WS-ReliableMessaging

WS-Coordination and WS-Transaction

WCF: Windows Communication Foundation

What is WCF?

Why is WCF used for SOA?

WCF architecture

Basic WCF concepts—WCF ABCs

Address

Binding

Contract

Service contract

Operation contract

Message contract

Data contract

Fault contract

Endpoint

Behavior

Hosting

Self hosting

Windows services hosting

IIS hosting

Windows Activation Services hosting

Channels

Metadata

WCF production and development environments

Summary

2. 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 the host application

Testing the host application

ASP.NET Development Server

Adding an SVC file to the host application

Modifying the web.config file

Starting the host application

Creating a client to consume the WCF service

Creating the client application project

Generating the proxy and configuration files

Customizing the client application

Running the client application

Setting the service application to AutoStart

Summary

3. Hosting and Debugging the HelloWorld WCF Service

Hosting the HelloWorld WCF service

Hosting the service in a managed application

Hosting the service in a console application

Consuming the service hosted in a console application

Hosting the service in a Windows service

Hosting the service in Internet Information Server

Preparing the folders and files

Turn on Internet Information Services

Creating the IIS application

Starting the WCF service in IIS

Testing the WCF service hosted in IIS

Other WCF service hosting options

Debugging the HelloWorld WCF service

Debugging from the client application

Starting the debugging process

Debugging on the client application

Attaching to ASP.NET Development Server

Stepping into the WCF service

Debugging only the WCF service

Starting the WCF Service in debugging mode

Starting the client application in non-debugging mode

Starting the WCF service and client applications in debugging mode

Attaching to a WCF service process

Running the WCF service and client applications in non-debugging mode

Debugging the WCF service hosted in IIS

Just-In-Time debugger

Summary

4. Implementing a WCF Service in the Real World

Why layer a service?

Creating a new solution and project using WCF templates

Using the C# WCF service library template

Using the C# WCF service application template

Creating the service interface layer

Creating the service interfaces

Creating the data contracts

Implementing the service contracts

Modifying the app.config file

Testing the service using WCF Test Client

Testing the service using our own client

Adding a business logic layer

Adding the product entity project

Adding the business logic project

Calling the business logic layer from the service interface layer

Testing the WCF service with a business logic layer

Summary

5. Adding Database Support and Exception Handling to the RealNorthwind WCF Service

Adding a data access layer

Creating the data access layer project

Calling the data access layer from the business logic layer

Preparing the database

Adding the connection string to the configuration file

Querying the database (GetProduct)

Testing the GetProduct method

Updating the database (UpdateProduct)

Adding error handling to the service

Adding a fault contract

Throwing a fault exception

Updating the client program to catch the fault exception

Testing the fault exception

Summary

6. 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

Summary

7. LINQ to Entities: Basic Concepts and Features

ORM—Object-Relational Mapping

Entity Framework

LINQ to Entities

Comparing LINQ to Entities with LINQ to Objects

LINQ to SQL

Comparing LINQ to SQL with LINQ to Entities

Creating a LINQ to Entities test application

Creating the Data Model

Adding a LINQ to Entities item to the project

Generated LINQ to Entities classes

Querying and updating the database with a table

Querying records

Updating records

Inserting records

Deleting records

Running the program

View Generated SQL statements

View SQL statements using ToTraceString

View SQL statements using Profiler

Deferred execution

Checking deferred execution with SQL profiler

Deferred execution for singleton methods

Deferred execution for singleton methods within sequence expressions

Deferred (lazy) loading versus eager loading

Lazy loading by default

Eager loading the with Include method

Joining two tables

Querying a view

Summary

8. LINQ to Entities: Advanced Concepts and Features

Calling a stored procedure

Mapping a stored procedure to a new entity class

Modeling a stored procedure

Querying a stored procedure

Mapping a stored procedure to an existing entity class

Compiled query

Direct SQL

Dynamic query

Dynamic query with expressions

Dynamic query with parameters

Inheritance

LINQ to Entities Table per Hierarchy inheritance

Modeling the BaseCustomer and USACustomer entities

Modeling the UKCustomer entity

Generated classes with TPH inheritance

Testing the TPH inheritance

LINQ to Entities Table per Type inheritance

Preparing database tables

Modeling USACustomer1 and UKCustomer1 entities

Generated classes with TPT inheritance

Testing the TPT inheritance

Handling simultaneous (concurrent) updates

Detecting conflicts using a data column

Explaining the Concurrency Mode property

Adding another Entity Data Model

Writing the test code

Testing the conflicts

Turning on concurrency control

Detecting conflicts using a version column

Adding a version column

Modeling the Products table with a version column

Writing the test code

Testing the conflicts

Transaction support

Implicit transactions

Explicit transactions

Adding validations to entity classes

Debugging LINQ to Entities programs

Summary

9. 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

Modifying GetProduct in the data access layer

Modifying UpdateProduct in the data access layer

Testing LINQ to Entities with the WCF Test Client

Adding concurrency support

Turning on RowVersion concurrency mode

Modifying the ProductEntity class

Modifying the ProductDAO class

Modifying the GetProduct method

Modifying UpdateProduct method

Modifying the business logic layer classes

Modifying the service interface layer classes

Testing concurrency with WCF Test Client

Testing concurrency with our own client

Creating the test client

Implementing the GetProduct functionality

Implementing the UpdateProduct functionality

Testing the GetProduct and UpdateProduct operations

Testing concurrent update manually

Testing concurrent update automatically

Summary

10. Distributed Transaction Support of WCF

Creating the DistNorthwind solution

Hosting the WCF service in IIS

Testing the transaction behavior of the WCF service

Creating a client to call the WCF service sequentially

Testing the sequential calls to the WCF service

Wrapping the WCF service calls in one transaction scope

Testing multiple database support of the WCF service

Creating a new WCF service

Calling the new WCF service in the client application

Testing the WCF service with two databases

Enabling distributed transaction support

Enabling transaction flow in service binding

Enabling transaction flow on the service hosting application

Modifying the service operation contract to allow a transaction flow

Modifying the service operation implementation to require a transaction scope

Understanding the distributed transaction support of a WCF service

Testing the distributed transaction support of the WCF service

Configuring the Distributed Transaction Coordinator

Configuring the firewall

Propagating a transaction from the client to the WCF service

Testing distributed transaction support with one database

Testing distributed transaction support with two databases

Summary

Index

累计评论(0条) 1个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部