DeveelDB
20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
deveeldb.git
src
deveeldb-linq
Deveel.Data.Linq
QueryContext.cs
Go to the documentation of this file.
1
using
System
;
2
using
System
.Linq;
3
4
using
Deveel
.
Data
.
Mapping
;
5
6
using
IQToolkit
;
7
8
namespace
Deveel
.Data.Linq {
9
public
abstract
class
QueryContext
: IDisposable {
10
public
QueryContext
(
IQuery
context) {
11
ParentContext = context;
12
}
13
14
~QueryContext
() {
15
Dispose(
false
);
16
}
17
18
public
IQuery
ParentContext {
get
;
private
set; }
19
20
private
IQueryProvider Provider {
get
; set; }
21
22
private
DeveelDbProvider
CreateProvider
() {
23
if
(Provider == null) {
24
// TODO: Get all other settings as metadata
25
26
var mappingContext =
new
MappingContext
();
27
OnBuildMap(mappingContext);
28
29
var model = mappingContext.CreateModel();
30
31
Provider = ParentContext.GetQueryProvider(model);
32
}
33
34
return
(
DeveelDbProvider
) Provider;
35
}
36
37
protected
abstract
void
OnBuildMap(
MappingContext
mappingContext);
38
39
internal
IEntityTable<T> GetTable<T>() where T :
class
{
40
return
CreateProvider().GetTable<T>();
41
}
42
43
public
QueryTable<T>
Table<T>() where T :
class
{
44
return
new
QueryTable<T>
(
this
);
45
}
46
47
public
void
Dispose
() {
48
Dispose(
true
);
49
GC.SuppressFinalize(
this
);
50
}
51
52
protected
virtual
void
Dispose
(
bool
disposing) {
53
if
(disposing) {
54
}
55
56
Provider = null;
57
}
58
}
59
}
Deveel
System
Definition:
NonSerializedAttribute.cs:3
Deveel.Data.Mapping
Definition:
ColumnAttribute.cs:6
Deveel.Data.Linq.DeveelDbProvider
Definition:
DeveelDbProvider.cs:10
Deveel.Data.IQuery
Definition:
IQuery.cs:20
Deveel.Data.Linq.QueryContext.Dispose
virtual void Dispose(bool disposing)
Definition:
QueryContext.cs:52
Deveel.Data.Linq.QueryContext.CreateProvider
DeveelDbProvider CreateProvider()
Definition:
QueryContext.cs:22
Deveel.Data.Linq.QueryTable
Definition:
QueryTable.cs:10
Deveel.Data.Mapping.MappingContext
Definition:
MappingContext.cs:10
Deveel.Data.Linq.QueryContext.~QueryContext
~QueryContext()
Definition:
QueryContext.cs:14
Deveel.Data.Linq.QueryContext.Dispose
void Dispose()
Definition:
QueryContext.cs:47
Deveel.Data.Linq.QueryContext.QueryContext
QueryContext(IQuery context)
Definition:
QueryContext.cs:10
Deveel.Data
Definition:
ActiveSessionList.cs:22
Deveel.Data.Linq.QueryContext
Definition:
QueryContext.cs:9
IQToolkit
Generated by
1.8.10