4
$\begingroup$

I'm working as a teacher with college students, learning ASP.NET MVC with C#.

One pedagogical problem I have in this environment is how to do CRUD (create, delete, update, select and inner join etc) in the simplest way?

With ASP 6.0 the students had a big control when querying db with plain SQL. With Entity Framework, the learning curve is harder with the code used to get data from database etc.

After almost 20 years working with php/apache/mysql and asp/ms access there is hard to know which way to go, giving the students "basic/intermediate" knowledge in building dynamic responsive websites connecting to db.

A couple of years ago we started focus on c#.net and sql-server/LocalDB. A great decision! Two years ago we dived into ASP.NET MVC. Fun, but really hard to penetrate for the students. To be more exact, LINQ to SQL, MVC and entity framework are hard to handle in "this levels" and with shorter courses. Are there any good alternatives for LINQ to SQL working in Visual Studio 2017?

$\endgroup$
  • $\begingroup$ Linq is designed to be functional (non-mutating), as is sql. But create, delete, update are not functional or sql. These are an extension to sql. So you may struggle with them. $\endgroup$ – ctrl-alt-delor Aug 29 '17 at 9:32
  • $\begingroup$ Only one person really understands Entity Framework, so don't feel bad. $\endgroup$ – user737 Sep 1 '17 at 13:09
2
$\begingroup$

I cannot think of a better alternative for LINQ to SQL, especially in Visual Studio 2017. You have said that you have spent 2 years already into MVC, which means, familiarity with MVC can be assumed.

If so, I would say that don't give up on the LINQ + SQL + EF + MVC ( I will simply refer to this as the MVC combo ) combo yet. I am guessing that you have already looked at this link. I use that in my introductory sessions on MVC, and even newcomers ( I mean, people who have not even tried MVC, or any of the MVC combo components ) have found it easy to use. In my experience, 10 to 15 hours is all it takes to train folks on that (at least the basics).

Give it a go, and yes, if you have questions about that link as you teach the different sections, come back and post questions here. We will take care of it for you.

$\endgroup$
1
$\begingroup$

In my opinion there is none.

LINQ for SQL, ORM are only tools to reduce the amount off boilerplate and syntax error when writing SQL. They're not a replacement neither a total abstraction of RDBMS (and are not intended to be).

When intereacting with an RDBMS, it is mandatory to have grasp enough of the SQL before attacking higher level tools.

What you could do is to show them how much code and tests you would need when you write everything yourself, and how much you have when you use the tools. How much you have to change when a column is renamed, a new column is added, ...

Note that the "tests" part are important, because if you write your own SQL, you need to tests it, if it generated by a tool you used, you don't need to test it.

$\endgroup$
  • $\begingroup$ Now if we could just get the tools to do everything, including the testing, we could hit the beach! $\endgroup$ – user737 Sep 1 '17 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.