Skip to content

Commit

Permalink
Data project - remove unnecessary virtual declaration of navigation p…
Browse files Browse the repository at this point in the history
…roperties
  • Loading branch information
adelikat committed Nov 9, 2024
1 parent 1f63d5c commit 3ee2c57
Show file tree
Hide file tree
Showing 39 changed files with 135 additions and 135 deletions.
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Awards/PublicationAward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ public class PublicationAward
public int Id { get; set; }

public int PublicationId { get; set; }
public virtual Publication? Publication { get; set; }
public Publication? Publication { get; set; }

public int AwardId { get; set; }
public virtual Award? Award { get; set; }
public Award? Award { get; set; }

public int Year { get; set; }
}
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Awards/UserAward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ public class UserAward
public int Id { get; set; }

public int UserId { get; set; }
public virtual User? User { get; set; }
public User? User { get; set; }

public int AwardId { get; set; }
public virtual Award? Award { get; set; }
public Award? Award { get; set; }

public int Year { get; set; }
}
6 changes: 3 additions & 3 deletions TASVideos.Data/Entity/Forum/Forum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ public class Forum : BaseEntity
public int Id { get; set; }

public int CategoryId { get; set; }
public virtual ForumCategory? Category { get; set; }
public ForumCategory? Category { get; set; }

public virtual ICollection<ForumTopic> ForumTopics { get; set; } = [];
public virtual ICollection<ForumPost> ForumPosts { get; set; } = [];
public ICollection<ForumTopic> ForumTopics { get; set; } = [];
public ICollection<ForumPost> ForumPosts { get; set; } = [];

[StringLength(50)]
public string Name { get; set; } = "";
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Data/Entity/Forum/ForumCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
public class ForumCategory : BaseEntity
{
public int Id { get; set; }
public virtual ICollection<Forum> Forums { get; set; } = [];
public ICollection<Forum> Forums { get; set; } = [];

[StringLength(30)]
public string Title { get; set; } = "";
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Forum/ForumPoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class ForumPoll : BaseEntity
public int Id { get; set; }

public int TopicId { get; set; }
public virtual ForumTopic? Topic { get; set; }
public ForumTopic? Topic { get; set; }

[StringLength(500)]
public string Question { get; set; } = "";
Expand All @@ -15,5 +15,5 @@ public class ForumPoll : BaseEntity

public bool MultiSelect { get; set; }

public virtual ICollection<ForumPollOption> PollOptions { get; set; } = [];
public ICollection<ForumPollOption> PollOptions { get; set; } = [];
}
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Forum/ForumPollOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public class ForumPollOption : BaseEntity
public int Ordinal { get; set; }

public int PollId { get; set; }
public virtual ForumPoll? Poll { get; set; }
public ForumPoll? Poll { get; set; }

public virtual ICollection<ForumPollOptionVote> Votes { get; set; } = [];
public ICollection<ForumPollOptionVote> Votes { get; set; } = [];
}

public static class ForumPollOptionExtensions
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Forum/ForumPollOptionVote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ public class ForumPollOptionVote
public int Id { get; set; }

public int PollOptionId { get; set; }
public virtual ForumPollOption? PollOption { get; set; }
public ForumPollOption? PollOption { get; set; }

public int UserId { get; set; }
public virtual User? User { get; set; }
public User? User { get; set; }

public DateTime CreateTimestamp { get; set; }

Expand Down
6 changes: 3 additions & 3 deletions TASVideos.Data/Entity/Forum/ForumPost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ public class ForumPost : BaseEntity
public int Id { get; set; }

public int? TopicId { get; set; }
public virtual ForumTopic? Topic { get; set; }
public ForumTopic? Topic { get; set; }

public int ForumId { get; set; }
public virtual Forum? Forum { get; set; }
public Forum? Forum { get; set; }

public int PosterId { get; set; }
public virtual User? Poster { get; set; }
public User? Poster { get; set; }

[StringLength(50)]
public string? IpAddress { get; set; }
Expand Down
14 changes: 7 additions & 7 deletions TASVideos.Data/Entity/Forum/ForumTopic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ public class ForumTopic : BaseEntity
public int Id { get; set; }

public int ForumId { get; set; }
public virtual Forum? Forum { get; set; }
public Forum? Forum { get; set; }

public virtual ICollection<ForumPost> ForumPosts { get; set; } = [];
public virtual ICollection<ForumTopicWatch> ForumTopicWatches { get; set; } = [];
public ICollection<ForumPost> ForumPosts { get; set; } = [];
public ICollection<ForumTopicWatch> ForumTopicWatches { get; set; } = [];

[StringLength(500)]
public string Title { get; set; } = "";

public int PosterId { get; set; }
public virtual User? Poster { get; set; }
public User? Poster { get; set; }

public ForumTopicType Type { get; set; }

public bool IsLocked { get; set; }

public int? PollId { get; set; }
public virtual ForumPoll? Poll { get; set; }
public ForumPoll? Poll { get; set; }

public int? SubmissionId { get; set; }
public virtual Submission? Submission { get; set; }
public Submission? Submission { get; set; }

public int? GameId { get; set; }
public virtual Game.Game? Game { get; set; }
public Game.Game? Game { get; set; }
}

public static class ForumTopicQueryableExtensions
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Forum/ForumTopicWatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
public class ForumTopicWatch
{
public int UserId { get; set; }
public virtual User? User { get; set; }
public User? User { get; set; }

public int ForumTopicId { get; set; }
public virtual ForumTopic? ForumTopic { get; set; }
public ForumTopic? ForumTopic { get; set; }

public bool IsNotified { get; set; }
}
Expand Down
16 changes: 8 additions & 8 deletions TASVideos.Data/Entity/Game/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
public class Game : BaseEntity
{
public int Id { get; set; }
public virtual ICollection<GameVersion> GameVersions { get; set; } = [];

public virtual ICollection<Publication> Publications { get; set; } = [];
public virtual ICollection<Submission> Submissions { get; set; } = [];
public virtual ICollection<GameGenre> GameGenres { get; set; } = [];
public virtual ICollection<UserFile> UserFiles { get; set; } = [];
public virtual ICollection<GameGameGroup> GameGroups { get; set; } = [];
public virtual ICollection<GameGoal> GameGoals { get; set; } = [];
public ICollection<GameVersion> GameVersions { get; set; } = [];

public ICollection<Publication> Publications { get; set; } = [];
public ICollection<Submission> Submissions { get; set; } = [];
public ICollection<GameGenre> GameGenres { get; set; } = [];
public ICollection<UserFile> UserFiles { get; set; } = [];
public ICollection<GameGameGroup> GameGroups { get; set; } = [];
public ICollection<GameGoal> GameGoals { get; set; } = [];

[StringLength(100)]
public string DisplayName { get; set; } = "";
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Game/GameGameGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
public class GameGameGroup
{
public int GameId { get; set; }
public virtual Game? Game { get; set; }
public Game? Game { get; set; }

public int GameGroupId { get; set; }
public virtual GameGroup? GameGroup { get; set; }
public GameGroup? GameGroup { get; set; }
}
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Game/GameGenre.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
public class GameGenre
{
public int GameId { get; set; }
public virtual Game? Game { get; set; }
public Game? Game { get; set; }

public int GenreId { get; set; }
public virtual Genre? Genre { get; set; }
public Genre? Genre { get; set; }
}
6 changes: 3 additions & 3 deletions TASVideos.Data/Entity/Game/GameGoal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ public class GameGoal
{
public int Id { get; set; }
public int GameId { get; set; }
public virtual Game? Game { get; set; }
public Game? Game { get; set; }

[StringLength(50)]
public string DisplayName { get; set; } = "";

public virtual ICollection<Publication> Publications { get; set; } = [];
public virtual ICollection<Submission> Submissions { get; set; } = [];
public ICollection<Publication> Publications { get; set; } = [];
public ICollection<Submission> Submissions { get; set; } = [];
}

public static class GameGoalExtensions
Expand Down
8 changes: 4 additions & 4 deletions TASVideos.Data/Entity/Game/GameSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ public class GameSystem : BaseEntity
{
public int Id { get; set; } // Note that this is Non-auto-incrementing, we need Ids to be identical across any database

public virtual ICollection<GameSystemFrameRate> SystemFrameRates { get; set; } = [];
public ICollection<GameSystemFrameRate> SystemFrameRates { get; set; } = [];

public virtual ICollection<GameVersion> GameVersions { get; set; } = [];
public ICollection<GameVersion> GameVersions { get; set; } = [];

public virtual ICollection<Publication> Publications { get; set; } = [];
public virtual ICollection<Submission> Submissions { get; set; } = [];
public ICollection<Publication> Publications { get; set; } = [];
public ICollection<Submission> Submissions { get; set; } = [];

[StringLength(8)]
public string Code { get; set; } = "";
Expand Down
6 changes: 3 additions & 3 deletions TASVideos.Data/Entity/Game/GameSystemFrameRate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class GameSystemFrameRate : BaseEntity
public int Id { get; set; }

public int GameSystemId { get; set; }
public virtual GameSystem? System { get; set; }
public GameSystem? System { get; set; }

public double FrameRate { get; set; }

Expand All @@ -16,8 +16,8 @@ public class GameSystemFrameRate : BaseEntity

public bool Obsolete { get; set; }

public virtual ICollection<Submission> Submissions { get; set; } = [];
public virtual ICollection<Publication> Publications { get; set; } = [];
public ICollection<Submission> Submissions { get; set; } = [];
public ICollection<Publication> Publications { get; set; } = [];
}

public static class GameSystemFrameRateExtensions
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/Game/GameVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class GameVersion : BaseEntity
public int Id { get; set; }

public int GameId { get; set; }
public virtual Game? Game { get; set; }
public Game? Game { get; set; }
public int SystemId { get; set; }
public virtual GameSystem? System { get; set; }
public GameSystem? System { get; set; }

public ICollection<Publication> Publications { get; set; } = [];
public ICollection<Submission> Submissions { get; set; } = [];
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Data/Entity/Game/Genre.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public class Genre
[StringLength(20)]
public string DisplayName { get; set; } = "";

public virtual ICollection<GameGenre> GameGenres { get; set; } = [];
public ICollection<GameGenre> GameGenres { get; set; } = [];
}
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/PrivateMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ public class PrivateMessage : BaseEntity
public int Id { get; set; }

public int FromUserId { get; set; }
public virtual User? FromUser { get; set; }
public User? FromUser { get; set; }

public int ToUserId { get; set; }
public virtual User? ToUser { get; set; }
public User? ToUser { get; set; }

[StringLength(500)]
public string? Subject { get; set; }
Expand Down
34 changes: 17 additions & 17 deletions TASVideos.Data/Entity/Publication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,40 @@ public class Publication : BaseEntity, ITimeable
{
public int Id { get; set; }

public virtual ICollection<PublicationFile> Files { get; set; } = [];
public virtual ICollection<PublicationTag> PublicationTags { get; set; } = [];
public virtual ICollection<PublicationFlag> PublicationFlags { get; set; } = [];
public virtual ICollection<PublicationAward> PublicationAwards { get; set; } = [];
public virtual ICollection<PublicationMaintenanceLog> PublicationMaintenanceLogs { get; set; } = [];
public ICollection<PublicationFile> Files { get; set; } = [];
public ICollection<PublicationTag> PublicationTags { get; set; } = [];
public ICollection<PublicationFlag> PublicationFlags { get; set; } = [];
public ICollection<PublicationAward> PublicationAwards { get; set; } = [];
public ICollection<PublicationMaintenanceLog> PublicationMaintenanceLogs { get; set; } = [];

[ForeignKey(nameof(PublicationRating.PublicationId))]
public virtual ICollection<PublicationRating> PublicationRatings { get; set; } = [];
public ICollection<PublicationRating> PublicationRatings { get; set; } = [];

public virtual ICollection<PublicationUrl> PublicationUrls { get; set; } = [];
public ICollection<PublicationUrl> PublicationUrls { get; set; } = [];

public int? ObsoletedById { get; set; }
public virtual Publication? ObsoletedBy { get; set; }
public Publication? ObsoletedBy { get; set; }

public virtual ICollection<Publication> ObsoletedMovies { get; set; } = [];
public ICollection<Publication> ObsoletedMovies { get; set; } = [];

public int GameId { get; set; }
public virtual Game.Game? Game { get; set; }
public Game.Game? Game { get; set; }

public int SystemId { get; set; }
public virtual GameSystem? System { get; set; }
public GameSystem? System { get; set; }

public int SystemFrameRateId { get; set; }
public virtual GameSystemFrameRate? SystemFrameRate { get; set; }
public GameSystemFrameRate? SystemFrameRate { get; set; }

public int GameVersionId { get; set; }
public virtual GameVersion? GameVersion { get; set; }
public GameVersion? GameVersion { get; set; }

public int PublicationClassId { get; set; }
public virtual PublicationClass? PublicationClass { get; set; }
public PublicationClass? PublicationClass { get; set; }

public int SubmissionId { get; set; }
public virtual Submission? Submission { get; set; }
public virtual ICollection<PublicationAuthor> Authors { get; set; } = [];
public Submission? Submission { get; set; }
public ICollection<PublicationAuthor> Authors { get; set; } = [];

public byte[] MovieFile { get; set; } = [];

Expand All @@ -84,7 +84,7 @@ public class Publication : BaseEntity, ITimeable
double ITimeable.FrameRate => SystemFrameRate?.FrameRate ?? throw new InvalidOperationException($"{nameof(SystemFrameRate)} must not be lazy loaded!");

public int? GameGoalId { get; set; }
public virtual GameGoal? GameGoal { get; set; }
public GameGoal? GameGoal { get; set; }

public void GenerateTitle()
{
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/PublicationAuthor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
public class PublicationAuthor
{
public int UserId { get; set; }
public virtual User? Author { get; set; }
public User? Author { get; set; }

public int Ordinal { get; set; }

public int PublicationId { get; set; }
public virtual Publication? Publication { get; set; }
public Publication? Publication { get; set; }
}

public static class PublicationAuthorExtensions
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Data/Entity/PublicationFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class PublicationFile : BaseEntity
public int Id { get; set; }

public int PublicationId { get; set; }
public virtual Publication? Publication { get; set; }
public Publication? Publication { get; set; }

[StringLength(250)]
public string Path { get; set; } = "";
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Data/Entity/PublicationFlag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
public class PublicationFlag
{
public int PublicationId { get; set; }
public virtual Publication? Publication { get; set; }
public Publication? Publication { get; set; }

public int FlagId { get; set; }
public virtual Flag? Flag { get; set; }
public Flag? Flag { get; set; }
}

public static class PublicationFlagExtensions
Expand Down
Loading

0 comments on commit 3ee2c57

Please sign in to comment.