Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 4 and Visual Studio 2010 > BOOK: Professional WCF 4: Windows Communication Foundation with .NET 4
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional WCF 4: Windows Communication Foundation with .NET 4
This is the forum to discuss the Wrox book Professional WCF 4: Windows Communication Foundation with .NET 4 by Pablo Cibraro, Kurt Claeys, Fabio Cozzolino, Johann Grabner; ISBN: 978-0-470-56314-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional WCF 4: Windows Communication Foundation with .NET 4 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 23rd, 2011, 08:12 AM
Registered User
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation CHAPTER 11 CREATING A SOA CASE - Customer ambiguity


Enjoying a good read going through the complete example scenario in chapter 11 CREATING A SOA CASE " bit by bit. But in the "Creating Database Access for the CustomerService and the RentalService" section page 317 I get a bit confused.

Is this an error, or is it supposed to be like this. What are the overall picture of whats happening here?

In the CustomerService project I added the "LINQ to SQL Classes" (DataClassesCustomer.dbml) and dragged in the Customer table from the CarRentalCaseDB database in Server Explorer.

Fine, but when writing the code to CustomerServiceImplementation.cs I discovered that the 'Customer' class now had changed from beeing a CustomerInterface.Customer into beeing a CustomerService.Customer type.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;
using CustomerInterface;

namespace CustomerService
    public class CustomerServiceImplementation:ICustomer
        public int RegisterCustomer(Customer customer)

        // prior to creating DataClassesCustomer.dbml:
        // public int RegisterCustomer(CustomerInterface.Customer customer)
        // After creating DataClassesCustomer.dbml:
        // public int RegisterCustomer(CustomerService.Customer customer)

            using (DataClassesCustomerDataContext ctx = new DataClassesCustomerDataContext())
                Customer customerToInsert;
                customerToInsert = new Customer();
                customerToInsert.CustomerName = customer.CustomerName;
                customerToInsert.CustomerFirstName = customer.CustomerFirstName;
                return customerToInsert.CustomerID;
This does not happen in the similar creation of DataClassesRental.dbml, as the class names differ.

A Customer class is defined in the CustomerInterface project (ICustomer.cs), then used to define function parameters in the CustomerServices project (CustomerServiceImplementation.cs).

A Customer table with some identically named fields is created in the database.

Customer table is then used in the DataClassesCustomer.dbml to define a partial Customer class in the DataClassesCustomer.designer.cs file.

Which finally causes the Customer found in CustomerServiceImplementation.cs to change from beeing a CustomerInterface.Customer class to beeing a CustomerService.Customer.

Now, coincidence in this example maybe, or is this a normal happening?

Why this and are there any good guidelines/explanation on how to deal with this?

Is this an error that may cause errors in certain situations?

Hope for some good answers here:)
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 11 Creating relationships between tables bpl BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 November 13th, 2009 11:59 AM
chapter 11 figure 11-7 relative positioning pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 November 29th, 2007 06:11 AM
Ch 11 creating a user reg script ed123 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 September 28th, 2007 11:36 AM
creating a customer wishlist janice ASP.NET 1.0 and 1.1 Basics 7 September 30th, 2004 11:08 AM
Chp 11 - Creating htaccess JamesA BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 6 June 15th, 2004 08:01 AM

All times are GMT -4. The time now is 03:08 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.