Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Wolverine.Attributes;
using Wolverine.FluentValidation;
using Wolverine.FluentValidation.Internals;
Expand All @@ -13,8 +13,8 @@ internal class FluentValidationExtension : IWolverineExtension
{
public void Configure(WolverineOptions options)
{
options.Services.AddSingleton(typeof(IFailureAction<>), typeof(FailureAction<>));
options.Services.TryAddSingleton(typeof(IFailureAction<>), typeof(FailureAction<>));
Comment thread
XL1TTE marked this conversation as resolved.
Outdated

options.Services.AddSingleton(typeof(IProblemDetailSource<>), typeof(ProblemDetailSource<>));
options.Services.TryAddSingleton(typeof(IProblemDetailSource<>), typeof(ProblemDetailSource<>));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using Wolverine.FluentValidation;
using Wolverine.FluentValidation.Internals;
using Wolverine.Http.FluentValidation.Internals;


namespace Wolverine.Http.FluentValidation;

public static class UseFluentValidationProblemDetailExtension
Comment thread
XL1TTE marked this conversation as resolved.
Outdated
{
public static WolverineOptions UseFluentValidationProblemDetail(this WolverineOptions options)
{
options.Services.TryAddSingleton(typeof(IFailureAction<>), typeof(FailureAction<>));
options.Services.TryAddSingleton(typeof(IProblemDetailSource<>), typeof(ProblemDetailSource<>));

return options;
}
}
Loading