Click here to Skip to main content
15,896,154 members
Articles / Programming Languages / C#

Data Accessing Independent From Database And Entity With ADO.Net

Rate me:
Please Sign up or sign in to vote.
4.93/5 (10 votes)
26 Nov 2012CPOL11 min read 26.7K   1K   32  
This tutorial aims to show a basic approach for designing a data access layer independent from databases and entities.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataAccess;

namespace TestApplication
{
    [DatabaseTable(TableName="Test")] /*Class ismi veritabanı tablo ismi ile aynı ise kullanılmayabilir. Ancak Property'ler için DatabaseItem Attribute'ü kullanılacaksa en azından tanımlanması zorunludur.*/
    class Test
    {
        public Guid ID { get; set; }
        public string Name { get; set; }
        [DatabaseColumn(ColumnName="Date")] /*Property ismi Column ismi ile aynı ise kullanılmayabilir.*/
        public DateTime CreateDate { get; set; }
    }
}

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
Software Developer RkSoft GIS Solutions
Turkey Turkey
A recent graduate. Interested in .Net technologies especially on c# language, silverligt and wpf. Also jQuery is one of the interests. Now improwing skills in a development company and learning more everyday.

Comments and Discussions