22 lines
688 B
C#
22 lines
688 B
C#
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
|
|
};
|
|
}
|
|
}
|