RepoDB icon indicating copy to clipboard operation
RepoDB copied to clipboard

Enhancement: Introduce the ApplicationContext class.

Open mikependon opened this issue 3 years ago • 0 comments

Describe the enhancement

Introduce the application context class that holds the generalized and globalized value for the library.

Reading values:

var isAutomaticConversion = ApplicationContext.Get<bool>(ApplicationKeys.ConversionType);

if (isAutomaticConversion)
{
     ...
}

Setting values:

ApplicationContext.Set(ApplicationKeys.ConversionType, ConversionType.Automatic);

Additional Context

In general, this class can be utilized in any means, regardless of scenarios/use-cases. As a recommendation, the usual properties used by the application must be held by this class. See the Constant class properties (i.e.: DefaultBatchOperationSize and DefaultCacheItemExpirationInMinutes) and/or the Converter class properties (i.e.: ConversionType and EnumDefaultDatabaseType).

mikependon avatar Sep 17 '22 19:09 mikependon