2024-12-11 19:40:18 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2024-12-24 21:26:31 +04:00
|
|
|
|
using System.ComponentModel;
|
2024-12-11 19:40:18 +04:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ProjectHorseRacingOrg.Entities;
|
|
|
|
|
|
|
|
|
|
public class Horse
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; private set; }
|
2024-12-24 21:26:31 +04:00
|
|
|
|
|
|
|
|
|
[DisplayName("Вид")]
|
2024-12-11 19:40:18 +04:00
|
|
|
|
public string HorseSpecies { get; private set; } = string.Empty;
|
2024-12-24 21:26:31 +04:00
|
|
|
|
|
|
|
|
|
[DisplayName("Кличка")]
|
2024-12-11 19:40:18 +04:00
|
|
|
|
public string HorseNickName { get; private set; } = string.Empty;
|
2024-12-24 21:26:31 +04:00
|
|
|
|
|
|
|
|
|
public string FullName => $"{HorseSpecies} {HorseNickName}";
|
|
|
|
|
|
|
|
|
|
[DisplayName("Возраст")]
|
2024-12-11 19:40:18 +04:00
|
|
|
|
public int Age { get; private set; }
|
2024-12-24 21:26:31 +04:00
|
|
|
|
|
|
|
|
|
[DisplayName("Вес")]
|
2024-12-11 19:40:18 +04:00
|
|
|
|
public double Weight { get; private set; }
|
2024-12-24 21:26:31 +04:00
|
|
|
|
|
2024-12-11 19:40:18 +04:00
|
|
|
|
public static Horse CreateEntity(int id, string horseSpecies, string
|
|
|
|
|
horseNickName, int age, double weight)
|
|
|
|
|
{
|
|
|
|
|
return new Horse
|
|
|
|
|
{
|
|
|
|
|
Id = id,
|
|
|
|
|
HorseSpecies = horseSpecies ?? string.Empty,
|
|
|
|
|
HorseNickName = horseNickName ?? string.Empty,
|
|
|
|
|
Age = age,
|
|
|
|
|
Weight = weight
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|