public void SetPrices(SetPricesViewModel prices) { int standartId = _db.Types.FirstOrDefault(t => t.Name == "Стандартный").Id; int halfId = _db.Types.FirstOrDefault(t => t.Name == "Полулюкс").Id; int luxId = _db.Types.FirstOrDefault(t => t.Name == "Люкс").Id; SetPrices(prices.StandartPrice, prices.PlacePriceStandart, _db.Apartments.Where(a => a.TypeId == standartId)); SetPrices(prices.HalfLuxPrice, prices.PlacePriceHalfLux, _db.Apartments.Where(a => a.TypeId == halfId)); SetPrices(prices.LuxPrice, prices.PlacePriceLux, _db.Apartments.Where(a => a.TypeId == luxId)); }
public IActionResult SetPrices(SetPricesViewModel prices) { _repository.SetPrices(prices); return(RedirectToAction("List")); }