diff options
author | HombreLaser <sebastian-440@live.com> | 2022-09-15 20:55:44 -0500 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2022-09-15 20:55:44 -0500 |
commit | 2c9c2cc3b414115bca9b6c63ca7b20d49a8a8ec1 (patch) | |
tree | 0344372eca04eab992ece36c4e07511f6f0214c6 /Program.cs | |
parent | 3381c633fcd73e5159ae4a607835167ebdbb12ee (diff) |
Agregar autor
Diffstat (limited to 'Program.cs')
-rw-r--r-- | Program.cs | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -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<LibraryContext>(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(); |