// 注意这里有个&符号,并不是写错了,而是约定 就是这样写的ctx.GetObject("&SessionFactory") 这是官网地址http://nhforge.org/doc/nh/en/
var table = ((Spring.Data.NHibernate.LocalSessionFactoryObject)ctx.GetObject("&SessionFactory")).Configuration.GetClassMapping(typeof(BasAgreement)).Table; var map = table.ColumnIterator; foreach (NHibernate.Mapping.Column item in map) { var column = item.Name; }