PIBD14-Boyko-M.S.-GSM-Autot.../ProjectGSM/Entities/Status.cs
2024-11-05 03:59:13 +04:00

22 lines
660 B
C#

namespace ProjectGSM.Entities;
public class Status
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public DateTime CreatedAt { get; private set; } = DateTime.UtcNow;
public decimal? Price { get; private set; }
// Конструктор для создания сущности
public static Status CreateEntity(int id, string name, decimal? price = null, DateTime? dateTime = null)
{
return new Status
{
Id = id,
Name = name ?? string.Empty,
Price = price,
CreatedAt = dateTime ?? DateTime.UtcNow
};
}
}