Пример #1
0
        public async Task <ActionResult <DefaultResponse <bool> > > NewRole([FromBody] SaveRoleViewModel model)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(Response(false));
            }
            await _roleManagerAppService.Save(model);

            return(Response(true));
        }
Пример #2
0
        public async Task <ActionResult <RoleViewModel> > NewRole([FromBody] SaveRoleViewModel model)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(ModelStateErrorResponseError());
            }
            await _roleManagerAppService.Save(model);

            var savedModel = await _roleManagerAppService.GetDetails(model.Name);

            return(ResponsePost(nameof(Details), new { role = savedModel.Name }, savedModel));
        }