public async Task <ShowRate> UpdateAsync(ShowRate showRate) { _context.ShowRates.Update(showRate); await _context.SaveChangesAsync(); return(showRate); }
public async Task <ShowRate> PostAsync(ShowRate showRate) { await _context.ShowRates.AddAsync(showRate); await _context.SaveChangesAsync(); return(showRate); }
///<inheritdoc/> public async Task <ContractModels.Show> RateShowAsync(RateShow rateShow) { ShowRate rate = _mapper.Map <ShowRate>(rateShow); var showRate = await _showRateRepository.PostAsync(rate); var updatedShow = await UpdateAverageRateAsync(showRate.ShowId); return(_mapper.Map <ContractModels.Show>(updatedShow)); }