Exemplo n.º 1
0
        public async Task <IActionResult> Add([FromBody] UserRoleModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.GetErrorList()));
            }

            try
            {
                await _manager.AddAsync(model);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }

            return(Ok());
        }