From 2c9c2cc3b414115bca9b6c63ca7b20d49a8a8ec1 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 15 Sep 2022 20:55:44 -0500 Subject: Agregar autor --- Program.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Program.cs') diff --git a/Program.cs b/Program.cs index 1e7b232..2b4a6fe 100644 --- a/Program.cs +++ b/Program.cs @@ -3,17 +3,13 @@ using LibraryAPI.Models; var builder = WebApplication.CreateBuilder(args); -// Add services to the container. - -builder.Services.AddControllers(); +builder.Services.AddControllers().AddJsonOptions(x => x.JsonSerializerOptions.ReferenceHandler = System.Text.Json.Serialization.ReferenceHandler.IgnoreCycles); builder.Services.AddDbContext(opt => opt.UseNpgsql(builder.Configuration.GetConnectionString("LibraryContext"))); -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); -// Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); -- cgit v1.2.3