1+ using MongoDB . Bson ;
2+ using MongoDB . Bson . Serialization . Attributes ;
3+ using Newtonsoft . Json ;
4+
5+ namespace CosmosDbVectorSamples . Models ;
6+
7+ public class HotelData
8+ {
9+ [ BsonId ]
10+ [ JsonProperty ( "_id" ) ]
11+ public ObjectId Id { get ; set ; }
12+
13+ [ JsonProperty ( "HotelId" ) ]
14+ public string ? HotelId { get ; set ; }
15+
16+ [ JsonProperty ( "HotelName" ) ]
17+ public string ? HotelName { get ; set ; }
18+
19+ [ JsonProperty ( "Description" ) ]
20+ public string ? Description { get ; set ; }
21+
22+ [ JsonProperty ( "Description_fr" ) ]
23+ public string ? DescriptionFr { get ; set ; }
24+
25+ [ JsonProperty ( "Category" ) ]
26+ public string ? Category { get ; set ; }
27+
28+ [ JsonProperty ( "Tags" ) ]
29+ public List < string > ? Tags { get ; set ; }
30+
31+ [ JsonProperty ( "ParkingIncluded" ) ]
32+ public bool ? ParkingIncluded { get ; set ; }
33+
34+ [ JsonProperty ( "SmokingAllowed" ) ]
35+ public bool ? SmokingAllowed { get ; set ; }
36+
37+ [ JsonProperty ( "LastRenovationDate" ) ]
38+ public DateTime ? LastRenovationDate { get ; set ; }
39+
40+ [ JsonProperty ( "Rating" ) ]
41+ public double ? Rating { get ; set ; }
42+
43+ [ JsonProperty ( "Location" ) ]
44+ public LocationData ? Location { get ; set ; }
45+
46+ [ JsonProperty ( "Address" ) ]
47+ public AddressData ? Address { get ; set ; }
48+
49+ [ JsonProperty ( "Rooms" ) ]
50+ public List < RoomData > ? Rooms { get ; set ; }
51+
52+ // Embedding fields - will be added dynamically based on configuration
53+ [ BsonExtraElements ]
54+ [ JsonExtensionData ]
55+ public Dictionary < string , object > ? ExtraElements { get ; set ; }
56+ }
57+
58+ public class LocationData
59+ {
60+ [ JsonProperty ( "type" ) ]
61+ public string ? Type { get ; set ; }
62+
63+ [ JsonProperty ( "coordinates" ) ]
64+ public List < double > ? Coordinates { get ; set ; }
65+ }
66+
67+ public class AddressData
68+ {
69+ [ JsonProperty ( "StreetAddress" ) ]
70+ public string ? StreetAddress { get ; set ; }
71+
72+ [ JsonProperty ( "City" ) ]
73+ public string ? City { get ; set ; }
74+
75+ [ JsonProperty ( "StateProvince" ) ]
76+ public string ? StateProvince { get ; set ; }
77+
78+ [ JsonProperty ( "PostalCode" ) ]
79+ public string ? PostalCode { get ; set ; }
80+
81+ [ JsonProperty ( "Country" ) ]
82+ public string ? Country { get ; set ; }
83+ }
84+
85+ public class RoomData
86+ {
87+ [ JsonProperty ( "Description" ) ]
88+ public string ? Description { get ; set ; }
89+
90+ [ JsonProperty ( "Description_fr" ) ]
91+ public string ? DescriptionFr { get ; set ; }
92+
93+ [ JsonProperty ( "Type" ) ]
94+ public string ? Type { get ; set ; }
95+
96+ [ JsonProperty ( "BaseRate" ) ]
97+ public double ? BaseRate { get ; set ; }
98+
99+ [ JsonProperty ( "BedOptions" ) ]
100+ public string ? BedOptions { get ; set ; }
101+
102+ [ JsonProperty ( "SleepsCount" ) ]
103+ public int ? SleepsCount { get ; set ; }
104+
105+ [ JsonProperty ( "SmokingAllowed" ) ]
106+ public bool ? SmokingAllowed { get ; set ; }
107+
108+ [ JsonProperty ( "Tags" ) ]
109+ public List < string > ? Tags { get ; set ; }
110+ }
111+
112+ public class SearchResult
113+ {
114+ public HotelData ? Document { get ; set ; }
115+ public double Score { get ; set ; }
116+ }
117+
118+ public class InsertSummary
119+ {
120+ public int Total { get ; set ; }
121+ public int Inserted { get ; set ; }
122+ public int Updated { get ; set ; }
123+ public int Skipped { get ; set ; }
124+ public int Failed { get ; set ; }
125+ }
0 commit comments