Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Entity Framework and Microsoft SQL Server

I'm fairly new to mvc, asp.net, and .net framework in general.

I understand what models are, controllers and views, but what I don't get it is Entity Framework. I developed websites before using php, and when I needed to store some data I simply do that using MySql databases. I thought this is the case with asp.net, same concept but instead of MySql, Microsoft Sql server is used. Now I started to learn .net framework and I watched a lot of online tutorials and saw them using some classes inherited from DbContext to store data! Can anyone tell me where these classes store the data and why don't we use Microsoft Sql server instead?

like image 638
boring91 Avatar asked Sep 12 '25 12:09

boring91


1 Answers

Entity Framework is an Object Relational Mapping tool (ORM), a layer that sits between your database and code. The idea is that the ORM is database agnostic and will handle writing the SQL for you, so that you could (in theory) swap between SQL Server, MySQL, or whatever database you want with only configuration changes.

You can skip Entity Framework and use SQL directly with ASP.Net. Your tutorials just happen to use Entity Framework.

like image 188
NetHawk Avatar answered Sep 15 '25 03:09

NetHawk