diff --git a/Models/AppUser.cs b/Models/AppUser.cs index 28c0660..9dd2315 100644 --- a/Models/AppUser.cs +++ b/Models/AppUser.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Text.Json.Serialization; namespace TicketManager.Models { @@ -39,6 +40,7 @@ namespace TicketManager.Models [Display(Name = "Avatar")] public string Picture { get; set; } + [JsonIgnore] public List Assignments { get; set; } = new List(); [Display(Name = "Activity")] diff --git a/Startup.cs b/Startup.cs index 699c91a..4b0df45 100644 --- a/Startup.cs +++ b/Startup.cs @@ -14,7 +14,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.OpenApi.Models; using Microsoft.AspNetCore.Mvc.NewtonsoftJson; using Microsoft.AspNetCore.Authentication.JwtBearer; -using Newtonsoft.Json; +// using Newtonsoft.Json; using TicketManager.Data; [assembly: ApiController] @@ -48,12 +48,12 @@ namespace TicketManager options.Audience = "https://localhost:5001/api/V1/"; }); - services.AddControllers() - .AddNewtonsoftJson(options => - { - options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; // avoid cycle ref errors - } - ); + services.AddControllers(); + // .AddNewtonsoftJson(options => + // { + // options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; // avoid cycle ref errors + // } + // ); services.AddSpaStaticFiles(configuration => {