summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-09-15 20:55:44 -0500
committerHombreLaser <sebastian-440@live.com>2022-09-15 20:55:44 -0500
commit2c9c2cc3b414115bca9b6c63ca7b20d49a8a8ec1 (patch)
tree0344372eca04eab992ece36c4e07511f6f0214c6 /Program.cs
parent3381c633fcd73e5159ae4a607835167ebdbb12ee (diff)
Agregar autor
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs6
1 files changed, 1 insertions, 5 deletions
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<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();