Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何连接EF中的exist表_C#_Entity Framework - Fatal编程技术网

C# 如何连接EF中的exist表

C# 如何连接EF中的exist表,c#,entity-framework,C#,Entity Framework,我有一个问题:如何添加一个表,它已经存在于带有EF的数据库中了 公共数据库集网页\u成员身份{get;set;} 和型号: [Table("webpages_Membership")] public class webpages_Membership { [Key] public int UserId { get; set; } public DateTime CreateDate { get; set; } public string ConfirmationT

我有一个问题:如何添加一个表,它已经存在于带有EF的数据库中了

公共数据库集网页\u成员身份{get;set;}

和型号:

[Table("webpages_Membership")]
public class webpages_Membership
{
    [Key]
    public int UserId { get; set; }
    public DateTime CreateDate { get; set; }
    public string ConfirmationToken { get; set; }
    public bool IsConfirmed { get; set; }
    public DateTime LastPasswordFailureDate { get; set; }
    public int PasswordFailuresSinceLastSuccess { get; set; }
    public string Password { get; set; }
    public DateTime PasswordChangeDate { get; set; }
    public string PasswordSalt { get; set; }
    public string PasswordVerificationToken { get; set; }
    public DateTime PasswordVerificationTokenExpirationDate { get; set; }
}
问题是-当我尝试
更新数据库时,它会创建新表
dbo.webpages\u Membership
(前缀为dbo),但我要使用的表是
my\u project.webpages\u Membership




如何解决此问题?

您可以为表映射提供架构:

[Table("webpages_Membership", Schema = "my_project")]