<#@ Template Language="C#" #>
<#@ Assembly Name="System.dll" #>
<#@ Import Namespace="System" #>
<#@ Property Processor="PropertyProcessor" Name="DataAccessClassNamespace" #>
using System;
using System.Configuration;

namespace <#= DataAccessClassNamespace#>
{
    public abstract class DbDataAccessor : IDisposable
    {
        Database _db;

        public DbDataAccessor()
        {
            string connectionStringName = ConfigurationManager.AppSettings["connectionStringName"];
            _db = Database.GetInstance(connectionStringName);
        }

        protected Database Database
        {
            get
            {
                return _db;
            }
        }

        #region IDisposable Members

        public void Dispose()
        {
            Database.Dispose();
        }

        #endregion
    }
}
