36 lines
1.0 KiB
C#
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()
|
|||
|
{
|
|||
|
}
|
|||
|
}
|
|||
|
}
|