samedi 25 avril 2015

Connect to SQL Server from ASP.NET MVC application

I am entirely new to ASP.NET MVC. I have one ASP.NET 2.0 Framework Web application with below architecture

  • Web Based Application 3 - Tier Architecture
  • Data Access Layer C#, ADO.NET
  • Database – SQL Server 2008 R2
  • Authentication - Forms

I am moving the application to an ASP.NET MVC 4 architecture; can anybody suggest the best practices to go with for data access layer, assume the connection string will be in web.config?

Code-first? Or data-first approach? What is the difference with the above approach and Entity Framework?

Also while adding a controller for a model, amongst the below template which I need to choose?

  1. Empty ASP.NET MVC controller
  2. ASP.NET MVC controller with read/write actions using Entity Framework
  3. ASP.NET MVC controller with empty read/write actions
  4. Empty API controller
  5. API controller with read/write actions using Entity Framework
  6. API controller with empty read/write actions

What is the difference between the above templates?

Aucun commentaire:

Enregistrer un commentaire