0
我的代碼是這樣的找不到對象「dbo.Addresses」,因爲它不存在或您沒有權限
public class Address
{
public int Id { get; set; }
public string City { get; set; }
public int PostNo { get; set; }
public string Street { get; set; }
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
public System.Data.Entity.DbSet<MearnIt.Models.Address> Addresses { get; set; }
}
當我運行NuGet包管理器控制檯上的更新,數據庫命令時,它hrows這個錯誤。
Cannot find the object "dbo.Addresses" because it does not exist or you do not have permissions.
我不知道爲什麼它會拋出這樣的錯誤。任何人都可以指出herE出了什麼問題嗎?
異常告訴你檢查兩件事情。首先在遷移連接到的數據庫*上執行*。 –