A
A
Andrey Romanyuk2017-04-15 14:30:13
ASP.NET
Andrey Romanyuk, 2017-04-15 14:30:13

How to output related tables in ASP.NET MVC?

controller:

[HttpGet]
        public ActionResult Products()
        {
           



            return View();
        }
        
        [HttpPost]
        public ActionResult Products(string Buy)
        {

            return View();
        }

Products:
58037d1ec96c4226a16be923fa93f8fe.JPGTrash
46f3b63eb6a54ab1b13599f201fdda78.JPG
Query in SQL like this:
SELECT [Products].Name,[Products].Description,[Products].Price FROM Products,Trash WHERE [Trash].IdProduct=[Products].Id

How to present it in the controller, and then in the view? And with the help of what is it implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2017-04-20
@BLek2

Usually use an ORM like EntityFramework. It might be worth starting with examples .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question