When can I use Linq and when to use Sql? [closed]

-2

I have a series of doubts about when to use each of these, it would help me a lot to know their experiences

    
asked by Andrex_11 13.11.2018 в 18:26
source

2 answers

1

The advantage of using LINQ is that you have strongly typed queries, because the classes that are generated must match the schema of your database, this means that when you make a query using LINQ you can obtain a window that shows you the options allowed for your consult, is what is called 'intellisense', which greatly facilitates programming and prevents type errors.

    
answered by 14.11.2018 / 04:38
source
0

SQL is a language for database query, you can create tables, procedures, views, etc. etc. The important thing here is that SQL is on the database side .

On the contrary Linq is a Framework / .Net tool that helps you to work / process collections of objects in a simple way , instead of doing some operation one by one, it lets you do it on the whole. But this on the .Net side, whether you're on the web, desktop or mobile.

Now it should also be noted that there are tools like Linq to Sql or as Entity Framework that help you process information in the database using Linq in your .Net language, what they do internally is that they transform your Linq code into SQL queries.

    
answered by 13.11.2018 в 18:34