mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 11:46:40 +00:00
JSonIgnore M2M joint
This commit is contained in:
parent
e4fe81a45c
commit
1af2d95e7a
2 changed files with 9 additions and 7 deletions
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace TicketManager.Models
|
namespace TicketManager.Models
|
||||||
{
|
{
|
||||||
|
|
@ -39,6 +40,7 @@ namespace TicketManager.Models
|
||||||
[Display(Name = "Avatar")]
|
[Display(Name = "Avatar")]
|
||||||
public string Picture { get; set; }
|
public string Picture { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public List<Assignment> Assignments { get; set; } = new List<Assignment>();
|
public List<Assignment> Assignments { get; set; } = new List<Assignment>();
|
||||||
|
|
||||||
[Display(Name = "Activity")]
|
[Display(Name = "Activity")]
|
||||||
|
|
|
||||||
14
Startup.cs
14
Startup.cs
|
|
@ -14,7 +14,7 @@ using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using Microsoft.AspNetCore.Mvc.NewtonsoftJson;
|
using Microsoft.AspNetCore.Mvc.NewtonsoftJson;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Newtonsoft.Json;
|
// using Newtonsoft.Json;
|
||||||
using TicketManager.Data;
|
using TicketManager.Data;
|
||||||
|
|
||||||
[assembly: ApiController]
|
[assembly: ApiController]
|
||||||
|
|
@ -48,12 +48,12 @@ namespace TicketManager
|
||||||
options.Audience = "https://localhost:5001/api/V1/";
|
options.Audience = "https://localhost:5001/api/V1/";
|
||||||
});
|
});
|
||||||
|
|
||||||
services.AddControllers()
|
services.AddControllers();
|
||||||
.AddNewtonsoftJson(options =>
|
// .AddNewtonsoftJson(options =>
|
||||||
{
|
// {
|
||||||
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; // avoid cycle ref errors
|
// options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; // avoid cycle ref errors
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
|
|
||||||
services.AddSpaStaticFiles(configuration =>
|
services.AddSpaStaticFiles(configuration =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue