コード例 #1
0
        public async Task <IActionResult> AddToApplication(string UserId, ApplicationUser applicationUser)
        {
            if (ModelState.IsValid)
            {
                var user = await _userManager.FindByIdAsync(UserId);

                if (user != null)
                {
                    applicationUser.Create();
                    applicationUser.Employee_Id = user.Id;
                    var add = await _userService.AddApplication(user.Id, applicationUser);

                    if (add > 0)
                    {
                        return(Ok(add));
                    }
                    return(BadRequest());
                }
            }
            return(NotFound());
        }