Update packages, use explicit type, use Microsoft OpenApi package

This commit is contained in:
2025-06-12 17:43:22 +02:00
parent b3ca1ba703
commit d91b837e44
32 changed files with 138 additions and 230 deletions

View File

@@ -10,22 +10,6 @@ namespace Vegasco.WebApi.Endpoints;
public static class EndpointExtensions
{
public static IServiceCollection AddEndpointsFromAssemblyContaining<T>(this IServiceCollection services)
{
var assembly = typeof(T).Assembly;
ServiceDescriptor[] serviceDescriptors = assembly
.DefinedTypes
.Where(type => type is { IsAbstract: false, IsInterface: false } &&
type.IsAssignableTo(typeof(IEndpoint)))
.Select(type => ServiceDescriptor.Transient(typeof(IEndpoint), type))
.ToArray();
services.TryAddEnumerable(serviceDescriptors);
return services;
}
public static void MapEndpoints(this IEndpointRouteBuilder builder)
{
ApiVersionSet apiVersionSet = builder.NewApiVersionSet()