public async Task <IActionResult> Create([Bind("ID, fullName")] UserProfile profile) { var returnUser = await _profiles.GetUserProfile(profile.fullName); if (returnUser != null) { return(RedirectToAction("UserIndex", "Home", new { userID = returnUser.ID })); } else { if (ModelState.IsValid) { await _profiles.CreateUserProfile(profile); return(RedirectToAction("UserIndex", "Home", new { userID = profile.ID })); } } return(RedirectToAction("UserProfiles", "Create")); }
/// <summary> /// 创建用户 /// </summary> /// <param name="up"></param> /// <returns></returns> public bool CreateUserProfile(UserProfileInfo up) { return(dal.CreateUserProfile(up)); }