Advantages of LINQ to SQL in ASP.Net

Last Reply one month ago By dharmendr

Posted one month ago

Hai all,

I am confusing in realtime development.Everyone knows what is the use of LINQ and EDM.

In my case , i am directly use the connection string in web.config file and i am not using any LINQ or EDM. 

My entered details or saved in database , edited and updated.

It's working fine in my scenario, but is there any disadvantages without using LINQ or EDM.

Posted one month ago

Hi nagaraju60,

In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer.

When the application runs LINQ to SQL translates into SQL queries in the object model and sends them to the database for execution.

When the database returns the results LINQ to SQL translates them back to objects that you can work with in your own programming language.

Advantages LINQ to SQL:

  • No magic strings like you have in SQL queries
  • Intellisense
  • Compile check when database changes
  • Faster development
  • Unit of work pattern (context)
  • Auto-generated domain objects that are usable small projects
  • Lazy loading

Refer below link for more details.

https://stackoverflow.com/questions/593808/what-are-the-advantages-of-linq-to-sql

https://www.c-sharpcorner.com/UploadFile/c5c6e2/using-linq-in-net/