diff --git a/ProjectRacing/Entities/Horse.cs b/ProjectRacing/Entities/Horse.cs index f19c76c..947e2ea 100644 --- a/ProjectRacing/Entities/Horse.cs +++ b/ProjectRacing/Entities/Horse.cs @@ -9,10 +9,9 @@ public class Horse public bool Sex { get; private set; } public DateOnly Birthday { get; private set; } - public Owner? Owner { get; private set; } public int OwnerId { get; private set; } - public static Horse CreateEntity(int id, string nameOfHorse, bool sex, DateOnly birthday, Owner owner) + public static Horse CreateEntity(int id, string nameOfHorse, bool sex, DateOnly birthday, int ownerId) { return new Horse { @@ -20,8 +19,7 @@ public class Horse NameOfHorse = nameOfHorse, Sex = sex, Birthday = birthday, - Owner = owner, - OwnerId = owner.Id + OwnerId = ownerId }; } } \ No newline at end of file diff --git a/ProjectRacing/Entities/Jockey.cs b/ProjectRacing/Entities/Jockey.cs index d1fafaa..6d8549d 100644 --- a/ProjectRacing/Entities/Jockey.cs +++ b/ProjectRacing/Entities/Jockey.cs @@ -7,7 +7,6 @@ public class Jockey public int Age { get; private set; } public int Rating { get; private set; } public string Number { get; private set; } = string.Empty; - public static Jockey CreateEntity(int id, string nameOfJockey, int age, int rating, string number) { return new Jockey diff --git a/ProjectRacing/Entities/Owner.cs b/ProjectRacing/Entities/Owner.cs index b31cb7a..d71d36a 100644 --- a/ProjectRacing/Entities/Owner.cs +++ b/ProjectRacing/Entities/Owner.cs @@ -4,7 +4,6 @@ public class Owner public int Id { get; private set; } public string NameOfOwner { get; private set; } = string.Empty; public string Number { get; private set; } = string.Empty; - public static Owner CreateEntity(int id, string nameOfOwner, string number) { return new Owner diff --git a/ProjectRacing/Entities/Participants.cs b/ProjectRacing/Entities/Participants.cs index 7908a1a..87a20a3 100644 --- a/ProjectRacing/Entities/Participants.cs +++ b/ProjectRacing/Entities/Participants.cs @@ -4,28 +4,19 @@ public class Participants { public int ParticipantId { get; private set; } public int JockeyId { get; private set; } - public Jockey? Jockey { get; private set; } - public int HorseId { get; private set; } - public Horse? Horse { get; private set; } - public int CompetitionsId { get; private set; } - public Competitions? Competitions { get; private set; } - public TimeSpan HorseTime { get; private set; } public int HorsePlase { get; private set; } - public static Participants CreateEntity(int id, Jockey jockey, Horse horse, Competitions competitions, TimeSpan horseTime, int horsePlace) + public static Participants CreateEntity(int id, int jockeyId, int horseId, int competitionsId, TimeSpan horseTime, int horsePlace) { return new Participants { ParticipantId = id, - Jockey = jockey, - JockeyId = jockey.Id, - HorseId = horse.Id, - Horse = horse, - Competitions = competitions, - CompetitionsId = competitions.Id, + JockeyId = jockeyId, + HorseId = horseId, + CompetitionsId = competitionsId, HorseTime = horseTime, HorsePlase = horsePlace };