Answer the question
In order to leave comments, you need to log in
How to dynamically change list items in ASP.NET MVC 5?
Good afternoon!
There are two tables (Category, Specials). It is necessary that the user selects a category in the form on the site, and a list of relevant specialties is formed below.
Models:
Answer the question
In order to leave comments, you need to log in
As I understand it, your categories and specialties are connected one-to-many, so just complete the request. If you have ado.no, then you need a repository for each entity. And then you will have something like select * from SpecialsTable where categoryId = @param (where the parameter is defined in your Sharpcode like this: categoryRepository.GetAll().FirstOrDefault(c=>c.Id == your int parameter) You must describe the method yourself. You need to look for it on the metasite. Read Ado.net and the repository pattern. If you do it with EF, then it’s even a hundred times easier. I won’t write there, so everything is clear. You write the repository the same way, you also write LINQ in help for requests, I hope I helped a little.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question