/// <summary> /// Create a new OpenId object. /// </summary> /// <param name="openIdId">Initial value of the OpenIdId property.</param> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="openIdUrl">Initial value of the OpenIdUrl property.</param> public static OpenId CreateOpenId(global::System.Int32 openIdId, global::System.Int32 userId, global::System.String openIdUrl) { OpenId openId = new OpenId(); openId.OpenIdId = openIdId; openId.UserId = userId; openId.OpenIdUrl = openIdUrl; return(openId); }
/// <summary> /// Adds a new OpenId to the database. /// </summary> /// <param name="openid">OpenId to be added.</param> public void AddOpenId(OpenId openid) { Contract.Requires <ArgumentNullException>(openid != null); userDb.OpenIds.AddObject(openid); }
/// <summary> /// Create a new OpenId object. /// </summary> /// <param name="openIdId">Initial value of the OpenIdId property.</param> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="openIdUrl">Initial value of the OpenIdUrl property.</param> public static OpenId CreateOpenId(global::System.Int32 openIdId, global::System.Int32 userId, global::System.String openIdUrl) { OpenId openId = new OpenId(); openId.OpenIdId = openIdId; openId.UserId = userId; openId.OpenIdUrl = openIdUrl; return openId; }
/// <summary> /// Deprecated Method for adding a new object to the OpenIds EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToOpenIds(OpenId openId) { base.AddObject("OpenIds", openId); }
public ActionResult Register(User user, string identifier, string returnUrl, bool rememberMe) { //The registration form has been submitted try { if (ModelState.IsValid) { OpenId openid = new OpenId { OpenIdUrl = identifier, User = user }; users.AddOpenId(openid); users.SaveChanges(); // Now let's login out user to out application IssueFormsAuthenticationTicket(user, rememberMe); // We're done, let's get back to where we started from. if (string.IsNullOrEmpty(returnUrl)) return RedirectToAction("Index", "Home"); else return Redirect(returnUrl); } var registrationModel = new RegistrationViewModel(identifier) { Username = user.Username, Email = user.Email, FullName = user.FullName, ReturnUrl = returnUrl }; return View(registrationModel); } catch { var registrationModel = new RegistrationViewModel(identifier) { Username = user.Username, Email = user.Email, FullName = user.FullName, ReturnUrl = returnUrl }; return View(registrationModel); } }