-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathMappingsConfiguration.cs
70 lines (57 loc) · 1.71 KB
/
MappingsConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
namespace NHibernate.Cfg.Loquacious
{
public class MappingsConfiguration
#pragma warning disable 618
: IMappingsConfiguration
#pragma warning restore 618
{
private readonly FluentSessionFactoryConfiguration fc;
public MappingsConfiguration(FluentSessionFactoryConfiguration parent)
{
fc = parent;
}
public MappingsConfiguration UsingDefaultCatalog(string defaultCatalogName)
{
fc.Configuration.SetProperty(Environment.DefaultCatalog, defaultCatalogName);
return this;
}
public FluentSessionFactoryConfiguration UsingDefaultSchema(string defaultSchemaName)
{
fc.Configuration.SetProperty(Environment.DefaultSchema, defaultSchemaName);
return fc;
}
#region Implementation of IMappingsConfiguration
#pragma warning disable 618
IMappingsConfiguration IMappingsConfiguration.UsingDefaultCatalog(string defaultCatalogName)
{
return UsingDefaultCatalog(defaultCatalogName);
}
IFluentSessionFactoryConfiguration IMappingsConfiguration.UsingDefaultSchema(string defaultSchemaName)
{
return UsingDefaultSchema(defaultSchemaName);
}
#pragma warning restore 618
#endregion
}
public class MappingsConfigurationProperties
#pragma warning disable 618
:IMappingsConfigurationProperties
#pragma warning restore 618
{
private readonly Configuration configuration;
public MappingsConfigurationProperties(Configuration configuration)
{
this.configuration = configuration;
}
#region Implementation of IMappingsConfigurationProperties
public string DefaultCatalog
{
set { configuration.SetProperty(Environment.DefaultCatalog, value); }
}
public string DefaultSchema
{
set { configuration.SetProperty(Environment.DefaultSchema, value); }
}
#endregion
}
}