0

I have ben requested to create an application that uses an existing DB with stored procedures (insert, update, delete) and they don't want to use Entity Framework.

One way is to create my own Data Access Layer using System.Data.DataSet but I would like to know if there is any existing library or something I can use where I can fill objects from SP's and also update data using SP's.

Any clue?

VAAA
  • 14,531
  • 28
  • 130
  • 253
  • Check [Dapper.NET](https://github.com/StackExchange/dapper-dot-net#stored-procedures) – Federico Dipuma Apr 27 '16 at 21:22
  • 1
    Yes, Entity Framework. You can use stored procedures with EF. Usually though developers are given a task but not told they can't use specific tools that lend themselves nicely to the job. Why the requirement not to use EF? – Igor Apr 27 '16 at 21:24
  • Performance in EF is horrible with big datasets. – VAAA Apr 27 '16 at 21:30
  • Drapper sounds a good solution. – VAAA Apr 27 '16 at 21:40

3 Answers3

0

If you really want to go down this path, you can use Automapper

Take a look at this post How do I use automapper to map a dataset with multiple tables

Still, keep in mind that performance can actually be really bad.

IMHO, EF would be a better choice.

Community
  • 1
  • 1
0

You can use a micro-orm like Dapper which is simple, efficient and maps correctly to objects.

Example of use :

// Call spGetUser with a parameter Id and put the result in a User instance.  
var user = cnn.Query<User>("spGetUser", new {Id = 1}, 
        commandType: CommandType.StoredProcedure).SingleOrDefault();
Spilarix
  • 1,418
  • 1
  • 13
  • 24
0

I usually recommend to use Dapper. it is very light-weight, it's performance is on par with ADO.NET coding.

Riad Baghbanli
  • 3,105
  • 1
  • 12
  • 20