Commit inicial: ITCA_API_SAP_WMS (.NET Core 3.1)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GeorgeandClaude Sonnet 5.5 committed 2026-10-05 17:53:41 -05:00
commit 2b82744eb8
168 files changed
+11066

No files matched your search

@@ -0,0 +1,45 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using System.Net;
namespace Net.Business.Services
{
public static class ExceptionMiddlewareExtensions
{
public static void ConfigureExceptionHandler(this IApplicationBuilder app)
{
app.UseExceptionHandler(appError =>
{
appError.Run(async context =>
{
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
context.Response.ContentType = "application/json";
var contextFeature = context.Features.Get<IExceptionHandlerFeature>();
if (contextFeature != null)
{
await context.Response.WriteAsync(new DtoErrorDetails()
{
StatusCode = context.Response.StatusCode,
ErrorMessage = contextFeature.Error.Message.ToString()
}.ToString());
}
});
});
}
}
}
public class DtoErrorDetails
{
public int StatusCode { get; set; }
public string ErrorMessage { get; set; }
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
}
@@ -0,0 +1,54 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Net.Connection;
using Net.Data;
using System.Net.Http;
namespace Net.Business.Services
{
public static class ServiceExtensions
{
public static void ConfigureCors(this IServiceCollection services)
{
services.AddCors(opt =>
{
opt.AddPolicy("CorsPolicy",
builder => builder.WithOrigins("http://192.168.1.4", "http://localhost:4200")
.AllowAnyHeader()
.WithMethods("GET", "POST", "PUT", "PATH")
.AllowCredentials());
});
}
public static void ConfigureIISIntegration(this IServiceCollection services)
{
services.Configure<IISOptions>(options =>
{
});
}
public static void ConfigureSQLConnection(this IServiceCollection services)
{
services.AddScoped<IConnectionSQL, ConnectionSQL>();
}
public static void ConfigureRepositoryWrapper(this IServiceCollection services)
{
services.AddScoped<IRepositoryWrapper, RepositoryWrapper>();
}
public static void ConfigureHttpClientServiceLayer(this IServiceCollection services)
{
services.AddHttpClient("bypass-ssl-validation")
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (
httpRequestMessage, cert, certChain, policyErrors) =>
{
return true;
}
});
}
}
}