PIbd-23_Firsov_KA_SUBD/Hotel/HotelMongoDB/Models/MongoReservation.cs

34 lines
1.1 KiB
C#
Raw Permalink Normal View History

2024-05-29 17:06:07 +04:00
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelMongoDB.Models
{
public class MongoReservation
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
public string GuestId { get; set; } = string.Empty;
public string RoomId { get; set; } = string.Empty;
public string ArrivalDate { get; set; } = string.Empty;
public string DepartureDate { get; set; } = string.Empty;
public string Price { get; set; } = string.Empty;
public MongoReservation(HotelAbstractions.Models.Reservation model, string guest_id, string room_id)
{
GuestId = guest_id;
RoomId = room_id;
ArrivalDate = model.ArrivalDate.ToString("d");
DepartureDate = model.DepartureDate.ToString("d");
Price = model.Price.ToString();
}
public MongoReservation()
{
}
}
}