1

In my current situation I am one of two developers at a manufacturer. We have been extending the functionality of existing applications (ERP and some others).

These third party applications do not allow for much modification of their database as it may/would break the application. We are strongest in T-SQL and have many stored procedures that implement the logic needed to return a db set with a minimal wrapper to the .net applications.

I have also built another code-first application using Entity Framework that lives in Azure. I'd like to take some of the practices of this and apply it to what we are doing.

Keeping in mind we have little control over the third party applications what are the recommended best practices?

Would it still be using T-SQL with a minimal wrapper to return data or can we also do that using Entity Framework for some continuity between custom apps.

  • You can use Entity Framework as a minimalist wrapper, if you like, including calling your stored procedures. See docs.microsoft.com/en-us/ef/ef6/querying/raw-sql Or you can use a micro-ORM like Dapper. – Robert Harvey Oct 22 '18 at 17:37
  • Do you think making the wrapper a web api so all our applications could be consistent makes sense? Api.StoredProcedure? – Matt Oct 22 '18 at 17:57
  • Well, that's a different part of your application. I assumed you were discussing the Data Access Layer. – Robert Harvey Oct 22 '18 at 18:11
  • I'll add a second question to keep this one focused – Matt Oct 22 '18 at 18:28
-1

Entity framework is... fine.

But if you are happy with sql and sqlclient do yourself a favour and just skip it.

Just have a search on stackoverflow for EF questions and you see the trouble people get into.

There really isnt any concrete benefit EF has over sqlclient except saved typing.

In your particular case with an existing 3rd party database and stored procedures you have all the more reason to use custom code to interface between your code and the db rather than an ORM.

You will have cases which simple 'convention over configuration' cant apply and you are forced to get into the nitty gritty of the ORMs pardigm tohack things together.

Whereas with your own hardcoding mapping its simple to do a particular field or sproc differently from the others.

|improve this answer|||||
  • "Saved typing" is no small thing. – Robert Harvey Oct 22 '18 at 17:38
  • @rh code golf all the way – Ewan Oct 23 '18 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.