コード例 #1
0
        public async Task <IHttpActionResult> AddToRole(string userId, string roleId)
        {
            if (userId == null || roleId == null)
            {
                return(BadRequest());
            }
            var result = await _roleManager.AddToRole(userId, roleId);

            return(result.Succeeded ? (IHttpActionResult)NotFound() : Ok());
        }
コード例 #2
0
        public async Task <IHttpActionResult> AddToRole(string userId, string roleId)
        {
            if (string.IsNullOrWhiteSpace(userId) || string.IsNullOrWhiteSpace(roleId))
            {
                return(BadRequest("Incorrect input data value"));
            }

            var result = await _roleManager.AddToRole(userId, roleId);

            return(result.Succeeded ? (IHttpActionResult)NotFound() : Ok());
        }
コード例 #3
0
        public async Task <IHttpActionResult> AddToRole(string userId, string roleId)
        {
            var result = await _roleManager.AddToRole(userId, roleId);

            return(result.Succeeded ? (IHttpActionResult)NotFound() : Ok());
        }