-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1087 Introduced the ApplicationConfiguration and ApplicationConfigur…
…ationOptions class.
- Loading branch information
1 parent
a900e39
commit 306d8b0
Showing
9 changed files
with
82 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using RepoDb.Options; | ||
|
||
namespace RepoDb | ||
{ | ||
/// <summary> | ||
/// A static class that is being used to define the globalized configurations for the library. | ||
/// </summary> | ||
public static class ApplicationConfiguration | ||
{ | ||
#region Methods | ||
|
||
/// <summary> | ||
/// Setup the globalized configurations for the application. | ||
/// </summary> | ||
/// <param name="options">The option class that contains the value for the configurations.</param> | ||
public static void Setup(ApplicationConfigurationOptions options) => | ||
Options = options; | ||
|
||
#endregion | ||
|
||
#region Properties | ||
|
||
/// <summary> | ||
/// Gets the globalized configurations. | ||
/// </summary> | ||
public static ApplicationConfigurationOptions Options { get; private set; } = new ApplicationConfigurationOptions(); | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
RepoDb.Core/RepoDb/Options/ApplicationConfigurationOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using RepoDb.Enumerations; | ||
using System.Data; | ||
using System.Data.Common; | ||
|
||
namespace RepoDb.Options | ||
{ | ||
/// <summary> | ||
/// A class that is being used to define the globalized configurations for the application. | ||
/// </summary> | ||
public class ApplicationConfigurationOptions | ||
{ | ||
/// <summary> | ||
/// Gets or sets the value that defines the conversion logic when converting an instance of <see cref="DbDataReader"/> into a .NET CLR class. | ||
/// </summary> | ||
public ConversionType ConversionType { get; set; } = ConversionType.Default; | ||
|
||
/// <summary> | ||
/// Gets or sets the default value of the batch operation size. The value defines on this property mainly affects the batch size of the InsertAll, MergeAll and UpdateAll operations. | ||
/// </summary> | ||
public int DefaultBatchOperationSize { get; set; } = Constant.DefaultBatchOperationSize; | ||
|
||
/// <summary> | ||
/// Gets of sets the default value of the cache expiration in minutes. | ||
/// </summary> | ||
public int DefaultCacheItemExpirationInMinutes { get; set; } = Constant.DefaultCacheItemExpirationInMinutes; | ||
|
||
/// <summary> | ||
/// Gets or sets the default equivalent <see cref="DbType"/> of an enumeration if it is being used as a parameter to the execution of any non-entity-based operations. | ||
/// </summary> | ||
public DbType EnumDefaultDatabaseType { get; set; } = DbType.String; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters