public void AddRole(Role model) { var roles = roleService.GetAll(); if (roles.Exists(x => x.RoleName.Equals(model.RoleName))) { var role = roles.SingleOrDefault(x => x.RoleName.Equals(model.RoleName)); role.Description = model.Description; role.ModifiedBy = model.ModifiedBy; role.ModifiedDate = DateTime.Now; role.RecordStatus = (int)RecordStatus.Active; roleService.Update(role); } else { roleService.Create(model); } _unitOfWork.Save(); }
public void SaveChanges() { try { _unitOfWork.Save(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }