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

34 lines
925 B
C#
Raw Normal View History

2024-05-29 17:06:07 +04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson;
namespace HotelMongoDB.Models
{
public class MongoHotel
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
public string HotelName { get; set; } = string.Empty;
public string Address { get; set; } = string.Empty;
public string CountStar { get; set; } = string.Empty;
public string CountRoom { get; set; } = string.Empty;
public MongoHotel(HotelAbstractions.Models.Hotel model)
{
HotelName = model.HotelName;
Address = model.Address;
CountStar = model.CountStar.ToString();
CountRoom = model.CountRoom.ToString();
}
public MongoHotel()
{
}
}
}