Add SqlException config options and update dependencies
Added ConfigureSqlException methods to DependencyInjection for flexible SQL exception handling configuration. Updated RecApplicationTestBase to use new options. Bumped DigitalData.Core.Exceptions to v1.1.1.
This commit is contained in:
@@ -2,9 +2,11 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
using ReC.Application.Common.Behaviors;
|
using ReC.Application.Common.Behaviors;
|
||||||
using ReC.Application.Common.Constants;
|
using ReC.Application.Common.Constants;
|
||||||
using ReC.Application.Common.Options;
|
using ReC.Application.Common.Options;
|
||||||
|
using ReC.Application.Common.Procedures;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace ReC.Application;
|
namespace ReC.Application;
|
||||||
@@ -116,5 +118,23 @@ public static class DependencyInjection
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
#endregion ConfigureRecActions
|
#endregion ConfigureRecActions
|
||||||
|
|
||||||
|
#region ConfigureSqlException
|
||||||
|
public ConfigurationOptions ConfigureSqlException(Action<SqlExceptionOptions> configure)
|
||||||
|
{
|
||||||
|
_configActions.Enqueue(services => services.Configure(configure));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfigurationOptions ConfigureSqlException(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configActions.Enqueue(services =>
|
||||||
|
{
|
||||||
|
services.Configure<SqlExceptionOptions>(configuration);
|
||||||
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
#endregion ConfigureSqlException
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<PackageReference Include="AutoMapper" Version="15.1.0" />
|
<PackageReference Include="AutoMapper" Version="15.1.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.6.0" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.6.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.1" />
|
||||||
<PackageReference Include="FluentValidation" Version="12.1.0" />
|
<PackageReference Include="FluentValidation" Version="12.1.0" />
|
||||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.0" />
|
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.0" />
|
||||||
<PackageReference Include="MediatR" Version="13.1.0" />
|
<PackageReference Include="MediatR" Version="13.1.0" />
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public abstract class RecApplicationTestBase : IDisposable
|
|||||||
{
|
{
|
||||||
options.LuckyPennySoftwareLicenseKey = configuration["LuckyPennySoftwareLicenseKey"];
|
options.LuckyPennySoftwareLicenseKey = configuration["LuckyPennySoftwareLicenseKey"];
|
||||||
options.ConfigureRecActions(configuration.GetSection("RecAction"));
|
options.ConfigureRecActions(configuration.GetSection("RecAction"));
|
||||||
|
options.ConfigureSqlException(configuration.GetSection("SqlException"));
|
||||||
});
|
});
|
||||||
|
|
||||||
services.AddRecInfrastructure(opt =>
|
services.AddRecInfrastructure(opt =>
|
||||||
|
|||||||
Reference in New Issue
Block a user