public async Task <bool> SaveChangesAsync(Employee employee) { try { if (employee.Id == 0) { await _dbContext.AddAsync(employee); } else { _dbContext.Update(employee); } await _dbContext.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }
public async Task <bool> SaveChangesAsync(Comment comment) { try { if (comment.Id == 0) { await _dbContext.AddAsync(comment); } else { _dbContext.Update(comment); } await _dbContext.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }