Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Diagnostics.Contracts;
- using Castle.Services.Transaction;
- using NHibernate;
- namespace EnterpriseSample.Dao
- {
- public abstract class GenericDao<T> : IGenericDao<T> where T:class, new()
- {
- private readonly Func<ISession> _session;
- public GenericDao(Func<ISession> session)
- {
- Contract.Requires(session != null);
- this._session = session;
- }
- [Transaction]
- public IList<T> ListAll()
- {
- return _session().CreateCriteria(typeof(T)).List<T>();
- }
- public IList<T> ListAll(int maxResults)
- {
- throw new NotImplementedException();
- }
- public IList<T> FindAll(T exampleInstance, params string[] propertiesToExclude)
- {
- throw new NotImplementedException();
- }
- public IList<T> FindAll(T exampleInstance, int maxResults, params string[] propertiesToExclude)
- {
- throw new NotImplementedException();
- }
- public T FindOne(T exampleInstance, params string[] propertiesToExclude)
- {
- throw new NotImplementedException();
- }
- public T Save(T entity)
- {
- throw new NotImplementedException();
- }
- public T SaveOrUpdate(T entity)
- {
- throw new NotImplementedException();
- }
- public void Delete(T entity)
- {
- throw new NotImplementedException();
- }
- public T Update(T entity)
- {
- throw new NotImplementedException();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement