diff Agendas/trunk/src/Agendas.Repositories.NHibernate/RepositoryBase.cs @ 63:963b71ea6028

Repositorios con NH
author nelopauselli
date Tue, 17 May 2011 14:02:25 -0300
parents
children a2b14da4902f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Repositories.NHibernate/RepositoryBase.cs	Tue May 17 14:02:25 2011 -0300
@@ -0,0 +1,21 @@
+using NHibernate;
+
+namespace AltNetHispano.Agendas.Repositories.NHibernate
+{
+	public class RepositoryBase<T>
+	{
+		private readonly ISessionFactory _sessionFactory;
+
+		public RepositoryBase(ISessionFactory sessionFactory)
+		{
+			_sessionFactory = sessionFactory;
+		}
+
+		protected ISession Session { get { return _sessionFactory.GetCurrentSession(); } }
+
+		public void Save(T obj)
+		{
+			Session.Save(obj);
+		}
+	}
+}
\ No newline at end of file