olidev
olidev

Reputation: 20624

Is there a better way to save and retrieve data between object and database?

I have been writing many .NET applications in which SQL Server is involved.

For each database table, I wrote a corresponding class in .NET.

Example:

Class A
{
    property a;
}

Then I have to write another class to do with the class A for saving and retrieving from the database:

Class AdB
{
    public A parse(Datatable objectA){} // for parsing objectA from db to A

    public void add(A a){}   // write query to add A into the database

    public void remove(A a) {} // write query to remove A from the database

    public void update(A a) {} // write query to update A into the database
}

As a result, I have to write for test cases for the methods: parse(), add(), remove() and update()

Is there is a recent technology to make it simpler of saving and retrieving from and into database?

Upvotes: 1

Views: 139

Answers (1)

ceth
ceth

Reputation: 45295

May be Entity Framework is that what you need?

Upvotes: 2

Related Questions