2
我正在使用MVC 3構建Web應用程序。它具有不同角色和特權的用戶。我正在使用EF Code First方法創建數據庫。用戶我的模型類:EF Code First和ASP.NET會員供應商
public class Users
{
public int UserID { get; set; }
public Name Name { get; set; }
public Address Address { get; set; }
public Contact Contact { get; set; }
}
public class Name
{
[Required, MaxLength(50), Display(Name = "First Name"), Column("FirstName")]
public string FirstName { get; set; }
[MaxLength(50), Display(Name = "Middle Name"), Column("MiddleName")]
public string MiddleName { get; set; }
[Required, MaxLength(50), Display(Name = "Last Name"), Column("LastName")]
public string LastName { get; set; }
}
public class Address
{
[Required, MaxLength(50), Display(Name = "Street"), Column("Street")]
public string Street { get; set; }
[Required, MaxLength(50), Display(Name = "City"), Column("City")]
public string City { get; set; }
[Required, MaxLength(50), Display(Name = "Country"), Column("Country")]
public string Country { get; set; }
[Required, MaxLength(5), Display(Name = "Postal Code"), Column("PostalCode")]
public string PostalCode { get; set; }
}
public class Contact
{
[Required, MaxLength(50), Display(Name = "Email"), Column("Email")]
public string Email { get; set; }
[Required, MaxLength(50), Display(Name = "Phone"), Column("Phone")]
public string Phone { get; set; }
[Required, MaxLength(50), Display(Name = "Fax"), Column("Fax")]
public string Fax { get; set; }
}
但對於角色和身份驗證我想使用的默認文件夾App_Data
的aspnetdb.mdf
。如何將我的Users
表與aspnetdb.mdf
的默認Users
表相關聯?