Avoid circular references with some models
This commit is contained in:
parent
21328163f7
commit
e5b5b1f895
6 changed files with 15 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace LANCommander.Data.Models
|
namespace LANCommander.Data.Models
|
||||||
{
|
{
|
||||||
|
@ -11,6 +12,7 @@ namespace LANCommander.Data.Models
|
||||||
public string WorkingDirectory { get; set; }
|
public string WorkingDirectory { get; set; }
|
||||||
public bool PrimaryAction { get; set; }
|
public bool PrimaryAction { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public virtual Game Game { get; set; }
|
public virtual Game Game { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
namespace LANCommander.Data.Models
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace LANCommander.Data.Models
|
||||||
{
|
{
|
||||||
public class Company : BaseModel
|
public class Company : BaseModel
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public virtual ICollection<Game> PublishedGames { get; set; }
|
public virtual ICollection<Game> PublishedGames { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
public virtual ICollection<Game> DevelopedGames { get; set; }
|
public virtual ICollection<Game> DevelopedGames { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace LANCommander.Data.Models
|
namespace LANCommander.Data.Models
|
||||||
{
|
{
|
||||||
|
@ -6,6 +7,7 @@ namespace LANCommander.Data.Models
|
||||||
public class Genre : BaseModel
|
public class Genre : BaseModel
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
public virtual ICollection<Game> Games { get; set; }
|
public virtual ICollection<Game> Games { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace LANCommander.Data.Models
|
namespace LANCommander.Data.Models
|
||||||
{
|
{
|
||||||
|
@ -8,6 +9,7 @@ namespace LANCommander.Data.Models
|
||||||
{
|
{
|
||||||
[MaxLength(255)]
|
[MaxLength(255)]
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
public virtual Game Game { get; set; }
|
public virtual Game Game { get; set; }
|
||||||
public KeyAllocationMethod AllocationMethod { get; set; }
|
public KeyAllocationMethod AllocationMethod { get; set; }
|
||||||
[MaxLength(17)]
|
[MaxLength(17)]
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using LANCommander.Data.Enums;
|
using LANCommander.Data.Enums;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace LANCommander.Data.Models
|
namespace LANCommander.Data.Models
|
||||||
{
|
{
|
||||||
|
@ -13,6 +14,7 @@ namespace LANCommander.Data.Models
|
||||||
public int MaxPlayers { get; set; }
|
public int MaxPlayers { get; set; }
|
||||||
public int Spectators { get; set; }
|
public int Spectators { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public virtual Game Game { get; set; }
|
public virtual Game Game { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace LANCommander.Data.Models
|
namespace LANCommander.Data.Models
|
||||||
{
|
{
|
||||||
|
@ -8,6 +9,7 @@ namespace LANCommander.Data.Models
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public virtual List<Game> Games { get; set; }
|
public virtual List<Game> Games { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue