Skip to content

Commit 6ba683f

Browse files
committed
Fix some problems in extensions' configuration loading
1 parent eb5536e commit 6ba683f

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Extensions/Xtensive.Orm.Reprocessing/Configuration/ReprocessingConfigurationReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal sealed class ReprocessingConfigurationReader : IConfigurationSectionRea
99
// intermediate class for reading section
1010
private class ReprocessingOptions
1111
{
12-
public TransactionOpenMode DefaultTransactionOpenMode { get; set; }
12+
public TransactionOpenMode? DefaultTransactionOpenMode { get; set; }
1313

1414
public string DefaultExecuteStrategy { get; set; }
1515
}
@@ -47,7 +47,7 @@ private ReprocessingConfiguration ReadInternal(IConfigurationSection section)
4747

4848
var result = new ReprocessingConfiguration();
4949
if (reprocessingOptions.DefaultTransactionOpenMode != default) {
50-
result.DefaultTransactionOpenMode = reprocessingOptions.DefaultTransactionOpenMode;
50+
result.DefaultTransactionOpenMode = reprocessingOptions.DefaultTransactionOpenMode.Value;
5151
}
5252
if (!string.IsNullOrEmpty(reprocessingOptions.DefaultExecuteStrategy)) {
5353
var type = Type.GetType(reprocessingOptions.DefaultExecuteStrategy, false);

Extensions/Xtensive.Orm.Security/Configuration/Elements/ConfigurationSection.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,29 @@ public class ConfigurationSection : System.Configuration.ConfigurationSection
2121
[Obsolete("Use SecurityConfiguration.DefaultSectionName instead")]
2222
public static readonly string DefaultSectionName = "Xtensive.Orm.Security";
2323

24+
private const string HashingServiceElementName = "hashingService";
25+
private const string AuthenticationServiceElementName = "authenticationService";
26+
2427
/// <summary>
2528
/// Gets or sets the hashing service.
2629
/// </summary>
2730
/// <value>The hashing service.</value>
28-
[ConfigurationProperty(SecurityConfiguration.HashingServiceElementName, IsRequired = false)]
31+
[ConfigurationProperty(HashingServiceElementName, IsRequired = false)]
2932
public HashingServiceConfigurationElement HashingService
3033
{
31-
get { return (HashingServiceConfigurationElement) this[SecurityConfiguration.HashingServiceElementName]; }
32-
set { this[SecurityConfiguration.HashingServiceElementName] = value; }
34+
get { return (HashingServiceConfigurationElement) this[HashingServiceElementName]; }
35+
set { this[HashingServiceElementName] = value; }
3336
}
3437

3538
/// <summary>
3639
/// Gets or sets the authentication service.
3740
/// </summary>
3841
/// <value>The authentication service.</value>
39-
[ConfigurationProperty(SecurityConfiguration.AuthenticationServiceElementName, IsRequired = false)]
42+
[ConfigurationProperty(AuthenticationServiceElementName, IsRequired = false)]
4043
public AuthenticationServiceConfigurationElement AuthenticationService
4144
{
42-
get { return (AuthenticationServiceConfigurationElement) this[SecurityConfiguration.AuthenticationServiceElementName]; }
43-
set { this[SecurityConfiguration.AuthenticationServiceElementName] = value; }
45+
get { return (AuthenticationServiceConfigurationElement) this[AuthenticationServiceElementName]; }
46+
set { this[AuthenticationServiceElementName] = value; }
4447
}
4548
}
4649
}

0 commit comments

Comments
 (0)