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出了什么问题吗?
异常告诉你检查两件事情。首先在迁移连接到的数据库*上执行*。 –