PIBD14-Boyko-M.S.-GSM-Autot.../ProjectGSM/Entities/Court.cs

22 lines
688 B
C#
Raw Normal View History

2024-11-05 03:59:13 +04:00
namespace ProjectGSM.Entities;
public class Court
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public string Address { get; private set; } = string.Empty;
public DateTime CreatedAt { get; private set; } = DateTime.UtcNow;
// Конструктор для создания сущности
public static Court CreateEntity(int id, string name, string address, DateTime? createdAt = null)
{
return new Court
{
Id = id,
Name = name ?? string.Empty,
Address = address ?? string.Empty,
CreatedAt = createdAt ?? DateTime.UtcNow
};
}
}