Click here to Skip to main content
15,886,258 members
Articles / Programming Languages / C#

LINQ to SQL: All common operations (Insert, Update, Delete, Get) in one base class

Rate me:
Please Sign up or sign in to vote.
4.53/5 (42 votes)
31 May 2008CPOL8 min read 234.4K   3.5K   119  
A base class to perform all common LINQ to SQL operations.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Yazeed.Framework.Data
{
    /// <summary>
    /// Common interface for all Property Mapping Providers
    /// </summary>
    public interface IPropertyMappingProvider
    {
        /// <summary>
        /// Responsible for mapping the two properties
        /// </summary>
        /// <param name="entity">Entity received from the client code, <see cref="System.Object"/></param>
        /// <param name="LINQEntity">Entity retrieved from DB</param>
        /// <param name="LINQProperty"><see cref="System.Reflection.PropertyInfo"/> from LINQ entity
        /// retrieved from DB to be mapped</param>
        void MapProperties(object entity, object LINQEntity, PropertyInfo LINQProperty);
    }
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Jordan Jordan
MCAD.NET, MCPD.NET

Comments and Discussions