public void Edit(Employee employee) { if (employee is null) { throw new ArgumentNullException(nameof(employee)); } dB.Update(employee); }
public void Update(Employee employee) { if (employee is null) { throw new ArgumentNullException(nameof(employee)); } _db.Update(employee); _Logger.LogInformation($"Сотрудник id:{employee} отредактирован"); _db.SaveChanges(); }
public void Edit(Employee Employee) { if (Employee is null) { throw new ArgumentNullException(nameof(Employee)); } //var db_item = GetById(Employee.Id); //if(db_item is null) return; //db_item.FirstName = Employee.FirstName; //db_item.Surname = Employee.Surname; //db_item.Patronymic = Employee.Patronymic; //db_item.Age = Employee.Age; //_db.Attach(Employee); //_db.Entry(Employee).State = EntityState.Modified; _db.Update(Employee); }