From b2c8a278beba119b1d79fc598b773db83fa432c6 Mon Sep 17 00:00:00 2001 From: repka228 <54245562+repka228@users.noreply.github.com> Date: Mon, 11 Nov 2024 06:21:25 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=81=D1=83=D1=89=D0=BD=D0=BE=D1=81=D1=82=D0=B5?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectRacing/Entities/Horse.cs | 6 ++---- ProjectRacing/Entities/Jockey.cs | 1 - ProjectRacing/Entities/Owner.cs | 1 - ProjectRacing/Entities/Participants.cs | 17 ++++------------- 4 files changed, 6 insertions(+), 19 deletions(-) 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 };