view Source/DataAccess/DataAccessorTA.cs @ 5:f7d63a092920

Исправлено условие Where в тех случаях, когда репозитарий не является генериком
author cin
date Tue, 10 Mar 2015 16:02:11 +0300
parents f990fcb411a9
children
line wrap: on
line source

using BLToolkit.Data;
using BLToolkit.TypeBuilder;

namespace BLToolkit.DataAccess
{
	public abstract class DataAccessor<T,TA> : DataAccessor<T>
		where TA : DataAccessor<T>
	{
		#region Constructors

		[System.Diagnostics.DebuggerStepThrough]
		protected DataAccessor()
		{
		}

		[System.Diagnostics.DebuggerStepThrough]
		protected DataAccessor(DbManager dbManager)
			: base(dbManager)
		{
		}

		#endregion

		#region CreateInstance

		public static TA CreateInstance()
		{
			return TypeFactory.CreateInstance<TA>();
		}

		public static TA CreateInstance(DbManager dbManager)
		{
			return CreateInstance(dbManager, false);
		}

		public static TA CreateInstance(DbManager dbManager, bool dispose)
		{
			TA da = TypeFactory.CreateInstance<TA>();

			da.SetDbManager(dbManager, dispose);

			return da;
		}

		#endregion
	}
}