37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
namespace ProjectGSM.Entities;
|
|
|
|
public class Client
|
|
{
|
|
public int Id { get; private set; }
|
|
public string Name { get; private set; } = string.Empty;
|
|
public bool Sex { get; private set; }
|
|
public DateTime DateOfBirth { get; private set; }
|
|
public string Email { get; private set; } = string.Empty;
|
|
public string PhoneNumber { get; private set; } = string.Empty;
|
|
public string Address { get; private set; } = string.Empty;
|
|
public DateTime CreatedAt { get; private set; } = DateTime.UtcNow;
|
|
|
|
// Конструктор для создания сущности
|
|
public static Client CreateEntity(
|
|
int id,
|
|
string name,
|
|
bool sex,
|
|
DateTime dateOfBirth,
|
|
string email,
|
|
string phoneNumber,
|
|
string address)
|
|
{
|
|
return new Client
|
|
{
|
|
Id = id,
|
|
Name = name ?? string.Empty,
|
|
Sex = sex,
|
|
DateOfBirth = dateOfBirth,
|
|
Email = email ?? string.Empty,
|
|
PhoneNumber = phoneNumber ?? string.Empty,
|
|
Address = address ?? string.Empty,
|
|
CreatedAt = DateTime.UtcNow
|
|
};
|
|
}
|
|
}
|