ASP.NET MVC and Linq, when to use?

I just started working on an asp.net/C#.net application that will call several different procedures. The only thing these procedures do is to create the views of the database table, and the only thing I want to do is store the information in variables. Then select which columns I want to convert to JSON, and then create a JSON string. I actually wrote the code for this in C # .net, which is smaller, but since I switched to asp.net mvc, I'm a little unsure whether I should store it or go with the whole Linq task.

I tested the Linq -> SQL drag and drop functionality and instantly created about 200 lines of code using the set and get methods and all.

So my question is: is it still worth using Linq even for simple data extraction? In the end, this data will be sent to the javascript timeline, where I was told that MVC would be very useful in terms of Ajax functionality.

+3
source share
4 answers

Since you are using LINQ-to-SQL to retrieve data, I cannot think of any reason to NOT use it fully. Since April last year, I have been working on the MVC 1.0 project. During this time, I had to quickly get acquainted with a number of technologies, one of which is LINQ-to-SQL. Take part in this and also look at the repository template ... you will be very pleased and everything will go relatively smoothly.

, INSERT UPDATE, . LINQ-to-SQL - , , . "Pro LINQ (Language Integrated Query) # 2008" . , . , LINQ-to-SQL, .

JSON, LINQ-to-SQL , . 65 ... . , , ... . ...

+5

, !

LINQ2SQL .

Repository Pattern, ASP.NET MVC.

( / Webapp) , LINQ.

+1

LINQ , . LINQ , , , , .

0

Linq2Sql . , JSON ,

0

Source: https://habr.com/ru/post/1735292/


All Articles