I want to add all tables in the database with a prefix like 'pe_', then the mapping between a class and a table will be like this: Category(pe_Category), Product(pe_Product), etc.
I know that with one single map, i can do like this:
[Table("pe_Category")]
public class Category
{
public int CategoryId { get; set; }
}
But I don't like it cause there maybe have hundreds of entities.
So I'm finding a way to add the prefix globally, just like this:
public class Category
{
public int CategoryId { get; set; }
}
public class Product
{
public int ProductId { get; set; }
}
// Global config, will affect all entities
table.Name = "pe_" + Class.TypeName ;
Anybody can help me?