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 | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Data.Common;
|
---|
6 | using System.Data.SqlClient;
|
---|
7 |
|
---|
8 | namespace 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.