PIbd-23_Firsov_KA_SUBD/Hotel/HotelMongoDB/Models/MongoGuest.cs
2024-05-29 17:06:07 +04:00

36 lines
1.0 KiB
C#

using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HotelAbstractions.Models;
namespace HotelMongoDB.Models
{
public class MongoGuest
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
public string FIO { get; set; } = string.Empty;
public string PhoneNumber { get; set; } = string.Empty;
public string BirthDate { get; set; } = string.Empty;
public string PassportId { get; set; } = string.Empty;
public string Gender { get; set; } = string.Empty;
public MongoGuest(HotelAbstractions.Models.Guest model)
{
FIO = model.FIO;
PhoneNumber = model.PhoneNumber;
BirthDate = model.BirthDate.ToString("d");
PassportId = model.PassportId;
Gender = model.Gender.ToString();
}
public MongoGuest()
{
}
}
}