public Subscription(ApplicationUser subscriber, ApplicationUser publisher) { this.Subscriber = subscriber; this.SubscriberId = subscriber.Id; this.Publisher = publisher; this.PublisherId = publisher.Id; }
public UserViewModel(ApplicationUser publisher) : this(publisher.Id, publisher.UserName, publisher.Description) { }
public async Task<IActionResult> Register(RegisterViewModel model) { if (ModelState.IsValid) { var user = new ApplicationUser { UserName = model.Username, Email = model.Email, Description = model.Description }; var result = await userManager.CreateAsync(user, model.Password); if (result.Succeeded) { await signInManager.SignInAsync(user, isPersistent: false); logger.LogInformation(3, "User created a new account with password."); return RedirectToAction(nameof(HomeController.Index), "Home"); } AddErrors(result); } // If we got this far, something failed, redisplay form return View(model); }