Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ContextFactory.cs @ 3543

Last change on this file since 3543 was 3220, checked in by kgrading, 15 years ago

improved the DAL further, changed minor details for the presentation (#830)

File size: 853 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Data.Common;
6using System.Data.SqlClient;
7
8namespace HeuristicLab.Hive.Server.LINQDataAccess {
9  public class ContextFactory {
10    [ThreadStatic]
11    private static HiveDataContext _hiveDataContext;
12
13    [ThreadStatic]
14    private static SqlTransaction _currentTransaction;
15
16    public static HiveDataContext Context {
17      get {
18        if(_hiveDataContext == null)
19          _hiveDataContext = new HiveDataContext();
20        return _hiveDataContext;       
21      }
22      set {       
23        _hiveDataContext = value;
24      }
25    }
26
27    public static SqlTransaction CurrentTransaction {
28      get {
29        return _currentTransaction;
30      } set {
31        _currentTransaction = value;
32      }
33    }
34  }
35}
Note: See TracBrowser for help on using the repository browser.