29 lines
876 B
C#
Raw Permalink Normal View History

2024-12-11 09:33:12 +04:00
using ProjectAirline.Entities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAirline.Entities;
public class Passenger
2024-11-27 00:03:35 +04:00
{
2024-12-11 09:33:12 +04:00
public int Id { get; private set; }
public FoodPreferences FoodPreferences { get; private set; }
public string FirstName { get; private set; } = string.Empty;
public string LastName { get; private set; } = string.Empty;
public DateTime DateBirth { get; private set; }
public static Passenger CreateEntity(int id, FoodPreferences foodPreferences, string first, string last)
2024-11-27 00:03:35 +04:00
{
2024-12-11 09:33:12 +04:00
return new Passenger
2024-11-27 00:03:35 +04:00
{
2024-12-11 09:33:12 +04:00
Id = id,
FoodPreferences = foodPreferences,
FirstName = first ?? string.Empty,
LastName = last ?? string.Empty,
DateBirth = DateTime.Now
};
2024-11-27 00:03:35 +04:00
}
2024-12-11 09:33:12 +04:00
}