예제 #1
0
        public RoleView AddRole(AddRoleRequest request)
        {
            Role model = this._roleRepository.FindBy(request.ParentId);

            if (model == null)
            {
                throw new EntityIsInvalidException <string>(request.ParentId.ToString());
            }
            model.AddChild(request.Name, request.Description);
            this._uow.Commit();
            return(model.ConvertToRoleView());
        }