view Source/Data/Linq/DefaultDataContextInfo.cs @ 8:a34cfdde80d6

removed strong signing added FrameworkPathOverride for linux builds
author cin
date Wed, 29 Nov 2017 12:43:52 +0300
parents f990fcb411a9
children
line wrap: on
line source

using System;

namespace BLToolkit.Data.Linq
{
	using Data.Sql.SqlProvider;
	using DataProvider;
	using Mapping;

	class DefaultDataContextInfo : IDataContextInfo
	{
		private IDataContext _dataContext;
		public  IDataContext  DataContext    { get { return _dataContext ?? (_dataContext = new DbManager()); } }

		public MappingSchema  MappingSchema  { get { return Map.DefaultSchema; } }
		public bool           DisposeContext { get { return true; } }
		public string         ContextID      { get { return _dataProvider.Name; } }

		public ISqlProvider CreateSqlProvider()
		{
			return _dataProvider.CreateSqlProvider();
		}

		public IDataContextInfo Clone(bool forNestedQuery)
		{
			return new DataContextInfo(DataContext.Clone(forNestedQuery));
		}

		static readonly DataProviderBase _dataProvider = DbManager.GetDataProvider(DbManager.DefaultConfiguration);
	}
}