Entity Framework - how to specify the table name for an entity class manually

Michael Roma on Jun 28, 2012

Below is the syntax used to specify what the exact table and schema is for an entity class defined in your project. In the example below, accountbase is the database table name, Account is the name of the EF class.

[Table(“accountbase”, Schema = “dbo”)]
public class Account
{
    [Key]
    public int id { get; set; }

    public string Email { get; set; }
}