41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace ProjectHorseRacingOrg.Entities;
|
||
|
||
public class Horse
|
||
{
|
||
public int Id { get; private set; }
|
||
|
||
[DisplayName("Вид")]
|
||
public string HorseSpecies { get; private set; } = string.Empty;
|
||
|
||
[DisplayName("Кличка")]
|
||
public string HorseNickName { get; private set; } = string.Empty;
|
||
|
||
public string FullName => $"{HorseSpecies} {HorseNickName}";
|
||
|
||
[DisplayName("Возраст")]
|
||
public int Age { get; private set; }
|
||
|
||
[DisplayName("Вес")]
|
||
public double Weight { get; private set; }
|
||
|
||
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
|
||
};
|
||
}
|
||
}
|