Exemplo n.º 1
0
 public void Post([FromBody] CreateRoleUICommand command)
 {
     Execute(() =>
     {
         _roleLogic.Create(command);
     });
 }
        public void Create(CreateRoleUICommand command)
        {
            if (_systemRoleRepository.GetAll(x => x.Name == command.Name && !x.IsDeleted).Any())
            {
                throw new DomainException(ErrorMessage.RoleNameIsExist);
            }
            var systemRole = SystemRole.Create(command.Name, command.Description, new Guid(), _timeSource.LocalNow());

            using (var unitOfWork = _unitOfWorkFactory.GetCurrentUnitOfWork())
            {
                _systemRoleRepository.Add(systemRole);
                unitOfWork.Commit();
            }
        }
 public void Post(CreateRoleUICommand command)
 {
     _systemRoleLogic.Create(command);
 }