public IList<House> GetFullList()
{
try
{
var session = SessionFactory.GetCurrentSession();
return session.QueryOver<House>()
.OrderBy(x => x.Owner).Asc
.List<House>();
}
catch (NHibernate.ADOException nex)
{
log.Error(System.Reflection.MethodBase.GetCurrentMethod().Name + " Error-- " + nex.ToString());
throw new Exception(ExceptionConstants.ERR_DATABASE_ERROR);
}
}
上面的代码在“PostService.css”上。现在我正在尝试使用该方法将我的所有数据从数据库中检索到一个名为 AllHouses() 的视图中。House 的实体包括。所有者、价格、位置和描述。如何将我的数据放入 GridView。我也想做“编辑”“删除”功能..