Beispiel #1
0
        public async Task Register(RegisterRoleCommand command)
        {
            command.Validate();

            if (AddNotifications(command))
            {
                return;
            }

            LedgerIdentityRole role = new LedgerIdentityRole(command.Name);

            IdentityResult result = await _roleManager.CreateAsync(role);

            if (result.Succeeded)
            {
                await Publish(new RoleRegisteredIntegrationEvent(role.Id, role.Name));
            }
            else
            {
                AddNotifications(result);
            }
        }
Beispiel #2
0
        public async Task <IActionResult> Register([FromBody] RegisterRoleCommand command)
        {
            await _roleApplicationService.Register(command);

            return(CreateResponse());
        }