изменения сущностей
This commit is contained in:
parent
1f09536c8e
commit
b2c8a278be
@ -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
|
||||
};
|
||||
}
|
||||
}
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user