public void Add(DeanDTO dean) { if (dean == null) { throw new ValidationException("Декан не найден.", ""); } Dean addingDean = AutoMap <DeanDTO, Dean> .Map(dean); Database.Deans.Add(addingDean); Database.Commit(); }
public void Edit(DeanDTO dean) { try { if (dean == null) { throw new ValidationException("Декан не найден.", ""); } var findingDean = ValidateModule.ValidateDean(dean.Id); findingDean = AutoMap <DeanDTO, Dean> .Map(dean, findingDean); Database.Deans.Edit(findingDean); Database.Commit(); } catch (ValidationException) { throw; } }