Esempio n. 1
0
        public async Task <ShowRate> UpdateAsync(ShowRate showRate)
        {
            _context.ShowRates.Update(showRate);
            await _context.SaveChangesAsync();

            return(showRate);
        }
Esempio n. 2
0
        public async Task <ShowRate> PostAsync(ShowRate showRate)
        {
            await _context.ShowRates.AddAsync(showRate);

            await _context.SaveChangesAsync();

            return(showRate);
        }
Esempio n. 3
0
        ///<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));
        }