首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 使用NHibernate的库模式的一个例子

使用NHibernate的库模式的一个例子

  • 资源大小:5.88 MB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: nhibernate 一个 例子 使用 模式

资 源 简 介

Repository with NHibernate Introduction This project serves as an example on how to implement the Repository pattern in .NET using NHibernate (with FluentNHibernate). There is no official definition of the Repository pattern and many different implementations exist on the web. However, most sources will agree that the the Repository pattern is effectively the Factory pattern with the 4 basic CRUD operations (plus a LINQ-compatible GetAll()), like so: public interface IRepository{ T Get(object id); void Save(T value); void Update(T value); void Delete(T value); IList GetAll();} Description The beauty of Repository is in its simplicity. Grabbing an object from the database only requires two lines of code: ``` IRepository monkeyRepo = new NHibernateRepository(); Monkey m

文 件 列 表

nhibernate-repository-example
.svn
lib
RepositoryExample
RepositoryExample.sln
RepositoryExample.suo
Test
VIP VIP
0.280154s