comparison Source/Data/Linq/DefaultDataContextInfo.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 using System;
2
3 namespace BLToolkit.Data.Linq
4 {
5 using Data.Sql.SqlProvider;
6 using DataProvider;
7 using Mapping;
8
9 class DefaultDataContextInfo : IDataContextInfo
10 {
11 private IDataContext _dataContext;
12 public IDataContext DataContext { get { return _dataContext ?? (_dataContext = new DbManager()); } }
13
14 public MappingSchema MappingSchema { get { return Map.DefaultSchema; } }
15 public bool DisposeContext { get { return true; } }
16 public string ContextID { get { return _dataProvider.Name; } }
17
18 public ISqlProvider CreateSqlProvider()
19 {
20 return _dataProvider.CreateSqlProvider();
21 }
22
23 public IDataContextInfo Clone(bool forNestedQuery)
24 {
25 return new DataContextInfo(DataContext.Clone(forNestedQuery));
26 }
27
28 static readonly DataProviderBase _dataProvider = DbManager.GetDataProvider(DbManager.DefaultConfiguration);
29 }
30 }