Click here to Skip to main content
15,886,258 members
Articles / Web Development / ASP.NET

Enterprise Application Architecture with LINQ to SQL

Rate me:
Please Sign up or sign in to vote.
4.73/5 (44 votes)
17 Oct 200722 min read 294.1K   4.1K   277  
A discussion about architectural patterns for using LINQ to SQL in enterprise applications, along with performance implications
using System;
using System.Linq;
using System.Data;
using System.Data.Linq;
using System.Collections.Generic;
using System.Text;
/*
 **************************************************************
 * Author: Rohit Gadagkar (rohit.gadagkar@gmail.com)
 * Copyright © 2007 Rohit Gadagkar
 * License:
 * Free without any restrictions whatsoever 
 *
 * Created: 9/1/2007
 * 
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
 * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.
 **************************************************************  
*/

namespace DLinqContext
{
    /// <summary>
    /// Impose the ICustomer contract for the Customer class that is autogenerated
    /// by the Orcas designer.
    /// </summary>
    /// <remarks>
    /// The Orcas designer generates a DBML file when database objects are dragged
    /// and dropped onto the design surface. Classes are generated behind the scenes
    /// to represent the ORM mapping defined in the designer. This involves attribute
    /// based mapping matadata, where a class and its properties are marked with
    /// attributes to associate with a database schema.
    /// 
    /// The ICustomer imposition is to make this class usable to the 
    /// CRUDGen<T> generic container class used for unit testing.
    /// </remarks>
    public partial class Customer : ICustomer { }




    /// <summary>
    /// Define a contructor override that takes both connection and mapping source
    /// </summary>
    public partial class northwindDataContext
    {
        public northwindDataContext(IDbConnection cn, MappingSource map)
            : base(cn, map)
        { }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
I am a tech lead working for Cap Gemini. Although I primarily work with the Microsoft technology stack (including .NET and legacy technologies) I like to keep myself informed about developments in the Java world.

Comments and Discussions