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
1af2d95e7a
commit
f15d725a93
3 changed files with 7 additions and 12 deletions
|
|
@ -2,7 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using TicketManager.DTO;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace TicketManager.Models
|
namespace TicketManager.Models
|
||||||
{
|
{
|
||||||
|
|
@ -20,11 +20,13 @@ namespace TicketManager.Models
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
[DataType(DataType.Date)]
|
[DataType(DataType.Date)]
|
||||||
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = false)]
|
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}",
|
||||||
|
ApplyFormatInEditMode = false)]
|
||||||
public DateTime CreationDate { get; private set; } = DateTime.Now;
|
public DateTime CreationDate { get; private set; } = DateTime.Now;
|
||||||
|
|
||||||
[DataType(DataType.Date)]
|
[DataType(DataType.Date)]
|
||||||
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
|
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}",
|
||||||
|
ApplyFormatInEditMode = true)]
|
||||||
public DateTime EndingDate { get; set; }
|
public DateTime EndingDate { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Progress")]
|
[Display(Name = "Progress")]
|
||||||
|
|
@ -45,6 +47,7 @@ namespace TicketManager.Models
|
||||||
[Display(Name = "Project Manager")]
|
[Display(Name = "Project Manager")]
|
||||||
public AppUser Manager { get; set; }
|
public AppUser Manager { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public List<Assignment> Assignments { get; set; } = new List<Assignment>();
|
public List<Assignment> Assignments { get; set; } = new List<Assignment>();
|
||||||
|
|
||||||
public List<Ticket> Tickets { get; set; } = new List<Ticket>();
|
public List<Ticket> Tickets { get; set; } = new List<Ticket>();
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
- `React` client on the front-end (TypeScript)
|
- `React` client on the front-end (TypeScript)
|
||||||
- [Materialize](https://materializecss.com) CSS librairy for styling
|
- [Materialize](https://materializecss.com) CSS librairy for styling
|
||||||
- API: Newtonsoft.Json, to avoid cycle errors
|
|
||||||
- Hosting: ?
|
- Hosting: ?
|
||||||
- Authentication : [Auth0](https://auth0.com/)
|
- Authentication : [Auth0](https://auth0.com/)
|
||||||
- Analytics : Google Analytics & Mixpanel
|
- Analytics : Google Analytics & Mixpanel
|
||||||
|
|
@ -48,5 +47,5 @@
|
||||||
- [ ] error page redirect when offline.
|
- [ ] error page redirect when offline.
|
||||||
- [ ] ticket/files/activities list placeholders when empty
|
- [ ] ticket/files/activities list placeholders when empty
|
||||||
- [ ] think about public/private DTO's constructor, getters and setters
|
- [ ] think about public/private DTO's constructor, getters and setters
|
||||||
- [x] write dtos without circular dependencies
|
- [<span style="color:red">X</span>] write dtos without circular dependencies.
|
||||||
- [ ] use dtoRequest for PutProjects
|
- [ ] use dtoRequest for PutProjects
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,7 @@ using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
|
using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using Microsoft.AspNetCore.Mvc.NewtonsoftJson;
|
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
// using Newtonsoft.Json;
|
|
||||||
using TicketManager.Data;
|
using TicketManager.Data;
|
||||||
|
|
||||||
[assembly: ApiController]
|
[assembly: ApiController]
|
||||||
|
|
@ -49,11 +47,6 @@ namespace TicketManager
|
||||||
});
|
});
|
||||||
|
|
||||||
services.AddControllers();
|
services.AddControllers();
|
||||||
// .AddNewtonsoftJson(options =>
|
|
||||||
// {
|
|
||||||
// options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; // avoid cycle ref errors
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
|
|
||||||
services.AddSpaStaticFiles(configuration =>
|
services.AddSpaStaticFiles(configuration =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue