nHibernate 3.2新增了一种mapping by code的映射策略,很有意思。你可以自定义约定,并且按照约定定制自动映射策略,面对遗留数据库时这个功能往往很有用,另外,由于mapping by code是基于代码的(而不是xml文件…
假设你在设计自己的系统的时候采用的是MVC架构。例如 也许可能有很多童鞋会这样设计Service和Model. service: public class AccountService { public bool Login(string userName, string password) { // insert into account values(userName,password); …