I am using Entity Framework 4.1 with repository template (database already exists). My problem is the existence of the GROUP table (which is reserved). This is a production database that I cannot change.
So, using all of these methods above, I get the following error:
A βgroupβ is a reserved keyword and cannot be used as an alias unless it is escaped.
Can I tell the Entity Framework to use the following as the table name: [GROUP]
EDIT A class with a db context is as follows (removed)
public class AMTDatabase : DbContext { private IDbSet<GROUP> _Groups; public IDbSet<GROUP> Group { get { return _Groups ?? (_Groups = DbSet<GROUP>()); } } protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<GROUP>().ToTable("GROUP"); }
Thanks in advance
source share