34 lines
925 B
C#
34 lines
925 B
C#
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()
|
|
{
|
|
}
|
|
}
|
|
}
|