How to specify table name in Fluent NHibernate ClassMap class?
问题 I am newbie to NHibernate and trying to use Fluent for mapping. My entity class name is different from the database table name it has to be mapped to. I am using mapping class derived from ClassMap<> , but I can't specify the table name: the property TableName from ClassMap is read-only. Thanks for your help. 回答1: Use Table("table_name") instead. 回答2: Does it work like? public class UserAccountMap : ClassMap<UserAccount> { public UserAccountMap() { Table("User"); Id(x => x.UserID, "UserID")