public ActionResult Index() { var fishCollection = this.fishService.GetAll(); var model = new FishListViewModel() { FishCollection = fishCollection }; return(View(model)); }
public ActionResult Details(string name) { var fish = this.fishService.GetFishByName(name); var model = new FishListViewModel() { SelectedFish = fish }; return(View(model)); }
public ActionResult Index() { var fishListModel = new FishListViewModel(); if (Session["CurrentUserId"] != null) { var userId = (int)Session["CurrentUserId"]; fishListModel.Fishes = fishRepository.GetFishesByUserId(userId).ToList(); } return(View(fishListModel)); }
public IActionResult ChoosenFish(string id) { FishListViewModel obj = new FishListViewModel(); var data = db.fish.AsNoTracking().ToList(); obj.currCategory = _allCategories.AllCategories; List <FishViewModel> res = new List <FishViewModel>(); for (int i = 0; i < data.Count; i++) { for (int j = 1; j < obj.currCategory.ToList().Count + 1; j++) { if (data[i].categoryID == Convert.ToInt32(id)) { res.Add(data[i]); break; } } } return(View(res)); }