Ok, super dzięki za pomoc, mam jeszcze pytanko bo dotarłem do miejsca gdzie dodałem sobie do tabeli AspnetUsers jeszcze kilka własnych pól i chciałem powiązać tą tabele z własnymi tabelami Department i ProjectManager tak, aby przy dodawaniu użytkownika jeszcze wybrać z listy dane z tych dwóch tabel. Poniżej wrzuce jak wygląda u mnie kod(wiem, że pewnie nie jest idealnie lub tak się nie robi).
IdentityModels.cs
public class ApplicationUser : IdentityUser
{
public int DepartmentID { get; set; }
public Nullable<int> ProjectManagerID { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public string Phone { get; set; }
public virtual ProjectManager ProjectManager { get; set; }
public virtual Department Department { get; set; }
Controller.cs tutaj jak dodam do ApplicationUser jeszcze dwa pola DepartmentID i ProjectManager to zwraca błąd żeby dać SelectList lecz nie dokońca wiem jak powinno wyglądać wywołanie
public async Task<ActionResult> Register(RegisterViewModel model)
{
if (ModelState.IsValid)
{
var user = new ApplicationUser { UserName = model.Email, Email = model.Email, Name = model.Name, Surname = model.Surname, Phone = model.Surname};
var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
return RedirectToAction("Index", "Home");
}
Department.cs
public class Department
{
public int DepartmentID {get; set; }
public string DepartmentName { get; set; }
public virtual ICollection<ApplicationUser> ApplicationUsers { get; set; }
}