Learn LINQ to SQL (10): Examples of layered architectures

Source: Internet
Author: User
Tags serialization

Project Introduction

This section will modify the example of a guest book in The Learning LINQ to SQL (iii): Adding and deleting changes to a multi-tier architecture using WCF. We will establish the following projects:

L A, website Project WebSite: Guest Book Presentation layer

L B, Class Library project Contract: Defines a contract for data access services

L C, Class Library project service: Defining Data access Services

L D, Class Library project entity: Guest Book entity

L E, console Project host: Hosting data access Services

The references between projects are as follows:

L A references B and D;

L B references D and System.ServiceModel assemblies

L C References B, D, System.ServiceModel, and System.Data.Linq assemblies

L D Reference SYSTEM.DATA.LINQ Assembly

l e references C and System.ServiceModel assemblies

Generating mapping files and entities

Open the VS2008 command line prompt and execute the following command:

sqlmetal /conn:server=xxx;database=GuestBook;uid=xxx;pwd=xxx /map:c:\guestbook.map /code:c:\guestbook.cs /serialization:Unidirectional

Note that here we use the serialization switch to tell SQLMetal to automatically mark them as WCF data objects when they are generated. C:\GUESTBOOK after the build is finished. CS added to the entity project.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.