Exemplo n.º 1
0
        public async Task <ActionResult <UserRoleViewModel> > Post(UserRoleViewModel userRole)
        {
            var response = await _userRoleService.Create(userRole.ToModel());

            if (response != BusinessLogic.Enums.StatusCode.Created)
            {
                _logger.LogError($"UserRole {userRole.Name} not found.");
            }

            return(response == BusinessLogic.Enums.StatusCode.Created
                ? (ActionResult <UserRoleViewModel>)Ok()
                : Conflict());
        }