Exemplo n.º 1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var dailyStatistics = _context.DailyStatistics.Find(DailyStatistic.Id);

            _context.Entry(dailyStatistics).CurrentValues.SetValues(DailyStatistic);

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DailyStatisticExists(DailyStatistic.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }