Storage of a BD with EF in asp.net MVC project

2

I have a mvc web application that stores 2 files with extension .mdf and .ldf locally within the project, which I understand are the same ones that Sql Server uses and these are now inside the app_data folder that was generated with EF .

My queries: Is this practice new or could the BD always be carried within the system project? since when developing a desktop application previously with winform it was required that this installed sql server and containing the BD in the pc to be used inside it, to be able to just connect to it and start the data interaction.

By having my DB within the ASP.NET MVC project, is it possible that the server where the application is stored does not require the installation of the MSSQL SERVER data manager anymore and what advantages and disadvantages does this use bring to this form of local storage?

    
asked by Miko 10.03.2016 в 00:05
source

1 answer

4

> > > Is this practice new or could the BD always be carried within the system project?

is not a new practice, since from VS2010 you could dynamically attach a database to the sql server service

> > when developing a desktop application previously with winform it was required that this installed sql server and containing the DB

In a Windows Application development you can also perform a dynamic attch, it is only a matter of attaching the .mdf in the project, this will make the VS make a copy to the \ bin \ Debug and connect to it dynamically

Here

Visual Studio Database integrated into the project

I explain it using a .sdf (Sql Compact), but with an .mdf it applies in the same way if it has the Sql Server service running locally.

> > > > > > > > > By having my DB within the ASP.NET MVC project it is possible that the server where the application is stored no longer requires the installation of the MSSQL SERVER data manager

I'm afraid not, the attach is dynamic but the Sql Server service is required

> > what are the advantages and disadvantages of using this form of local storage?

The main advantage is that the db is integrated with the development in the same project, so moving the solution of folders or from one computer to another is transparent and you take the data with the code.

More than anything, it facilitates the development of this integrated whole, although later in a deployment in production it would be advisable that the DB be integrated into the Sql Server service.

    
answered by 10.03.2016 / 00:56
source