Esempio n. 1
0
        public object Delete(SaveRole request)
        {
            var success = _roleManager.Delete(request.Role);

            var issues = _messageBusService.Fetch().Select(m => m.Details); ;

            if (success)
                request.Role = null;

            return new ServiceResult<Role>
            {
                Success = success,
                Result = request.Role,
                Errors = issues
            };
        }
Esempio n. 2
0
        public object Post(SaveRole request)
        {
            int id;
            var success = _roleManager.Create(request.Role, out id);

            if (success)
                request.Role.ID = id;

            var issues = _messageBusService.Fetch().Select(m => m.Details); ;

            return new ServiceResult<Role>
            {
                Success = success,
                Result = request.Role,
                Errors = issues
            };
        }