// 입력 public async Task <CalendarCenter> AddAsync(CalendarCenter model) { _context.CalendarCenter.Add(model); try { await _context.SaveChangesAsync(); } catch (Exception e) { _logger.LogError($"에러 발생({nameof(AddAsync)}): {e.Message}"); } return(model); }
// 수정 public async Task <bool> EditAsync(CalendarCenter model) { _context.CalendarCenter.Attach(model); _context.Entry(model).State = EntityState.Modified; try { return(await _context.SaveChangesAsync() > 0 ? true : false); } catch (Exception e) { _logger.LogError($"에러발생({nameof(EditAsync)}): {e.Message}"); } return(false); }