diff --git a/AMWD.Common.AspNetCore/AMWD.Common.AspNetCore.csproj b/AMWD.Common.AspNetCore/AMWD.Common.AspNetCore.csproj
index fb2fb64..90ea471 100644
--- a/AMWD.Common.AspNetCore/AMWD.Common.AspNetCore.csproj
+++ b/AMWD.Common.AspNetCore/AMWD.Common.AspNetCore.csproj
@@ -19,7 +19,10 @@
AMWD.Common.AspNetCoreicon.png
- https://git.am-wd.de/AM.WD/common
+ https://wiki.am-wd.de/libs/common
+
+ git
+ https://git.am-wd.de/AM.WD/common.gitAM.WD Common Library for ASP.NET CoreLibrary with classes and extensions used frequently on AM.WD projects.
diff --git a/AMWD.Common.AspNetCore/Extensions/ApplicationBuilderExtensions.cs b/AMWD.Common.AspNetCore/Extensions/ApplicationBuilderExtensions.cs
index 356080e..334ed04 100644
--- a/AMWD.Common.AspNetCore/Extensions/ApplicationBuilderExtensions.cs
+++ b/AMWD.Common.AspNetCore/Extensions/ApplicationBuilderExtensions.cs
@@ -14,9 +14,8 @@ namespace Microsoft.AspNetCore.Builder
/// Adds settings to run behind a reverse proxy (e.g. NginX).
///
///
- /// A base path (e.g. running in a sub-directory /app) for the application is defined via
- /// - ASPNETCORE_APPL_PATH environment variable (preferred)
- /// - AspNetCore_Appl_Path in the settings file
+ /// A base path (e.g. running in a sub-directory /app) for the application is defined via ASPNETCORE_APPL_PATH environment variable.
+ ///
///
/// Additionally you can specify the proxy server by using or a when there are multiple proxy servers.
///
diff --git a/AMWD.Common.AspNetCore/Extensions/ModelStateDictionaryExtensions.cs b/AMWD.Common.AspNetCore/Extensions/ModelStateDictionaryExtensions.cs
index c7c3c97..d539746 100644
--- a/AMWD.Common.AspNetCore/Extensions/ModelStateDictionaryExtensions.cs
+++ b/AMWD.Common.AspNetCore/Extensions/ModelStateDictionaryExtensions.cs
@@ -19,9 +19,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
/// The that specifies the property.
/// The error message to add.
/// No member expression provided.
-#pragma warning disable IDE0060 // remove unused parameters
public static void AddModelError(this ModelStateDictionary modelState, TModel model, Expression> keyExpression, string errorMessage)
-#pragma warning restore IDE0060 // remove unused parameters
{
if (modelState is null)
throw new ArgumentNullException(nameof(modelState));
diff --git a/AMWD.Common.AspNetCore/ModelBinders/CustomFloatingPointModelBinder.cs b/AMWD.Common.AspNetCore/ModelBinders/InvariantFloatingPointModelBinder.cs
similarity index 88%
rename from AMWD.Common.AspNetCore/ModelBinders/CustomFloatingPointModelBinder.cs
rename to AMWD.Common.AspNetCore/ModelBinders/InvariantFloatingPointModelBinder.cs
index 0ce5e52..706d792 100644
--- a/AMWD.Common.AspNetCore/ModelBinders/CustomFloatingPointModelBinder.cs
+++ b/AMWD.Common.AspNetCore/ModelBinders/InvariantFloatingPointModelBinder.cs
@@ -9,24 +9,24 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
///
/// Custom floating point ModelBinder as the team of Microsoft is not capable of fixing their issue with other cultures than en-US.
///
- public class CustomFloatingPointModelBinder : IModelBinder
+ public class InvariantFloatingPointModelBinder : IModelBinder
{
private readonly NumberStyles supportedNumberStyles;
private readonly ILogger logger;
private readonly CultureInfo cultureInfo;
///
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
///
/// The .
/// The .
/// The .
- public CustomFloatingPointModelBinder(NumberStyles supportedStyles, CultureInfo cultureInfo, ILoggerFactory loggerFactory)
+ public InvariantFloatingPointModelBinder(NumberStyles supportedStyles, CultureInfo cultureInfo, ILoggerFactory loggerFactory)
{
this.cultureInfo = cultureInfo ?? throw new ArgumentNullException(nameof(cultureInfo));
supportedNumberStyles = supportedStyles;
- logger = loggerFactory?.CreateLogger();
+ logger = loggerFactory?.CreateLogger();
}
///
diff --git a/AMWD.Common.AspNetCore/ModelBinders/CustomFloatingPointModelBinderProvider.cs b/AMWD.Common.AspNetCore/ModelBinders/InvariantFloatingPointModelBinderProvider.cs
similarity index 89%
rename from AMWD.Common.AspNetCore/ModelBinders/CustomFloatingPointModelBinderProvider.cs
rename to AMWD.Common.AspNetCore/ModelBinders/InvariantFloatingPointModelBinderProvider.cs
index fcaa809..cb61ed5 100644
--- a/AMWD.Common.AspNetCore/ModelBinders/CustomFloatingPointModelBinderProvider.cs
+++ b/AMWD.Common.AspNetCore/ModelBinders/InvariantFloatingPointModelBinderProvider.cs
@@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
/// options.ModelBinderProviders.Insert(0, new CustomFloatingPointModelBinderProvider());
/// });
///
- public class CustomFloatingPointModelBinderProvider : IModelBinderProvider
+ public class InvariantFloatingPointModelBinderProvider : IModelBinderProvider
{
///
/// Gets or sets the supported globally.
@@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
modelType == typeof(double) ||
modelType == typeof(float))
{
- return new CustomFloatingPointModelBinder(SupportedNumberStyles, CultureInfo, loggerFactory);
+ return new InvariantFloatingPointModelBinder(SupportedNumberStyles, CultureInfo, loggerFactory);
}
return null;
diff --git a/AMWD.Common.EntityFrameworkCore/AMWD.Common.EntityFrameworkCore.csproj b/AMWD.Common.EntityFrameworkCore/AMWD.Common.EntityFrameworkCore.csproj
index cc2685f..6c306ec 100644
--- a/AMWD.Common.EntityFrameworkCore/AMWD.Common.EntityFrameworkCore.csproj
+++ b/AMWD.Common.EntityFrameworkCore/AMWD.Common.EntityFrameworkCore.csproj
@@ -19,7 +19,10 @@
AMWD.Common.EntityFrameworkCoreicon.png
- https://git.am-wd.de/AM.WD/common
+ https://wiki.am-wd.de/libs/common
+
+ git
+ https://git.am-wd.de/AM.WD/common.gitAM.WD Common Library for EntityFramework CoreLibrary with classes and extensions used frequently on AM.WD projects.
diff --git a/AMWD.Common/AMWD.Common.csproj b/AMWD.Common/AMWD.Common.csproj
index 0c00c3c..554f691 100644
--- a/AMWD.Common/AMWD.Common.csproj
+++ b/AMWD.Common/AMWD.Common.csproj
@@ -19,7 +19,10 @@
AMWD.Commonicon.png
- https://git.am-wd.de/AM.WD/common
+ https://wiki.am-wd.de/libs/common
+
+ git
+ https://git.am-wd.de/AM.WD/common.gitAM.WD Common LibraryLibrary with classes and extensions used frequently on AM.WD projects.
diff --git a/AMWD.Common/Utilities/DelayedTask.cs b/AMWD.Common/Utilities/DelayedTask.cs
index a4b68aa..8d20124 100644
--- a/AMWD.Common/Utilities/DelayedTask.cs
+++ b/AMWD.Common/Utilities/DelayedTask.cs
@@ -5,16 +5,20 @@ using System.Threading.Tasks;
namespace AMWD.Common.Utilities
{
+ // originally inspired by a code from Yves Goergen (unclassified.software).
+
///
- /// Implements an awaitable task that runs after a specified delay. The delay can be reset
- /// before and after the task has run. By resetting the delay, the task can be executed multiple
- /// times. The scheduled or executing or last executed task can be awaited, until the delay is
- /// reset. After that, the next execution can be awaited.
+ /// Implements an awaitable task that runs after a specified delay. The delay can be reset.
+ /// By resetting the delay, the task can be executed multiple times.
///
public class DelayedTask
{
#region Data
+ private Timer timer;
+
+ private bool nextRunPending;
+
///
/// The synchronisation object.
///
@@ -25,7 +29,15 @@ namespace AMWD.Common.Utilities
///
protected Action exceptionHandler;
- private Timer timer;
+ ///
+ /// Provides the for the method.
+ ///
+ protected TaskCompletionSourceWrapper tcs;
+
+ ///
+ /// Gets or sets the action to execute.
+ ///
+ protected Action Action { get; set; }
///
/// Gets a value indicating whether the timer is running and an execution is scheduled. This
@@ -39,22 +51,6 @@ namespace AMWD.Common.Utilities
///
public bool IsRunning { get; private set; }
- ///
- /// Indicates whether the action shall be executed again after the currently ongoing
- /// execution has completed.
- ///
- private bool nextRunPending;
-
- ///
- /// Provides the for the method.
- ///
- protected TaskCompletionSourceWrapper tcs;
-
- ///
- /// Gets or sets the action to execute.
- ///
- protected Action Action { get; set; }
-
///
/// Gets or sets the delay to wait before executing the action.
///
@@ -66,53 +62,41 @@ namespace AMWD.Common.Utilities
///
/// Creates a new task instance that executes the specified action after the delay, but does
- /// not start it yet. Multiple executions are allowed when calling after
- /// the executed was started.
+ /// not start it yet.
///
/// The action to execute.
/// The delay.
///
public static DelayedTask Create(Action action, TimeSpan delay)
- {
- return new DelayedTask { Action = action, Delay = delay };
- }
+ => new() { Action = action, Delay = delay };
///
/// Creates a new task instance that executes the specified action after the delay, but does
- /// not start it yet. Multiple executions are allowed when calling after
- /// the executed was started.
+ /// not start it yet.
///
/// The action to execute.
/// The delay.
///
public static DelayedTaskWithResult Create(Func action, TimeSpan delay)
- {
- return DelayedTaskWithResult.Create(action, delay);
- }
+ => DelayedTaskWithResult.Create(action, delay);
///
- /// Executes the specified action after the delay. Multiple executions are allowed when
- /// calling after the executed was started.
+ /// Executes the specified action after the delay.
///
/// The action to execute.
/// The delay.
///
public static DelayedTask Run(Action action, TimeSpan delay)
- {
- return new DelayedTask { Action = action, Delay = delay }.Start();
- }
+ => new DelayedTask { Action = action, Delay = delay }.Start();
///
- /// Executes the specified action after the delay. Multiple executions are allowed when
- /// calling after the executed was started.
+ /// Executes the specified action after the delay.
///
/// The action to execute.
/// The delay.
///
public static DelayedTaskWithResult Run(Func action, TimeSpan delay)
- {
- return DelayedTaskWithResult.Run(action, delay);
- }
+ => DelayedTaskWithResult.Run(action, delay);
#endregion Static methods
@@ -158,7 +142,7 @@ namespace AMWD.Common.Utilities
}
///
- /// Cancels the delay. Any pending executions are cleared. If the action was pending but not
+ /// Cancels the delay. Any pending execution is cleared. If the action was pending but not
/// yet executing, this task is cancelled. If the action was not pending or is already
/// executing, this task will be completed successfully after the action has completed.
///
@@ -185,13 +169,7 @@ namespace AMWD.Common.Utilities
///
/// Starts a pending execution immediately, not waiting for the timer to elapse.
///
- /// true, if an execution was started; otherwise, false.
- ///
- /// A new execution is only started if one is currently waiting to run, or already running.
- /// In the former case, the execution is scheduled immediately with the timer; in the latter
- /// case, it is scheduled for when the currently running execution has completed. If an
- /// execution has been started (the method returned true), it can be awaited normally.
- ///
+ /// true, if an execution was started; otherwise, false.
public bool ExecutePending()
{
lock (syncObj)
@@ -287,9 +265,7 @@ namespace AMWD.Common.Utilities
///
///
protected virtual TaskCompletionSourceWrapper CreateTcs()
- {
- return new TaskCompletionSourceWrapper