New Layout
This commit is contained in:
@@ -1,15 +1,35 @@
|
||||
using GeradoresService.DAL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Primus.ProfitabilityModel.WebAPI.Filters;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.AddControllers().AddJsonOptions(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
|
||||
});
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddSwaggerGen(options =>
|
||||
{
|
||||
options.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
|
||||
options.SwaggerDoc("v1", new OpenApiInfo
|
||||
{
|
||||
|
||||
Version = "v1",
|
||||
Title = "FactoryId",
|
||||
Contact = new OpenApiContact
|
||||
{
|
||||
Name = "Marco Santos"
|
||||
},
|
||||
});
|
||||
|
||||
// Registra o filtro de esquema que aplica descri<72><69>es para todos os enums
|
||||
options.SchemaFilter<EnumDescriptionFilter>();
|
||||
});
|
||||
|
||||
|
||||
var connectionString = builder.Configuration.GetConnectionString("GeradoresConnection");
|
||||
|
||||
Reference in New Issue
Block a user