34 lines
1.1 KiB
C#
34 lines
1.1 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;
|
|||
|
|
|||
|
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()
|
|||
|
{
|
|||
|
}
|
|||
|
}
|
|||
|
}
|