2024-12-24 21:26:31 +04:00

41 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
};
}
}