-
Notifications
You must be signed in to change notification settings - Fork 424
/
Hotel.Methods.cs
68 lines (56 loc) · 2.01 KB
/
Hotel.Methods.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Text;
namespace AzureSearchQuickstart
{
public partial class Hotel
{
// This implementation of ToString() is only for the purposes of the sample console application.
// You can override ToString() in your own model class if you want, but you don't need to in order
// to use the Azure AI Search .NET SDK.
public override string ToString()
{
var builder = new StringBuilder();
if (!String.IsNullOrEmpty(HotelId))
{
builder.AppendFormat("HotelId: {0}\n", HotelId);
}
if (!String.IsNullOrEmpty(HotelName))
{
builder.AppendFormat("Name: {0}\n", HotelName);
}
if (!String.IsNullOrEmpty(Description))
{
builder.AppendFormat("Description: {0}\n", Description);
}
if (!String.IsNullOrEmpty(DescriptionFr))
{
builder.AppendFormat("Description (French): {0}\n", DescriptionFr);
}
if (!String.IsNullOrEmpty(Category))
{
builder.AppendFormat("Category: {0}\n", Category);
}
if (Tags != null && Tags.Length > 0)
{
builder.AppendFormat("Tags: [ {0} ]\n", String.Join(", ", Tags));
}
if (ParkingIncluded.HasValue)
{
builder.AppendFormat("Parking included: {0}\n", ParkingIncluded.Value ? "yes" : "no");
}
if (LastRenovationDate.HasValue)
{
builder.AppendFormat("Last renovated on: {0}\n", LastRenovationDate);
}
if (Rating.HasValue)
{
builder.AppendFormat("Rating: {0}\n", Rating);
}
if (Address != null && !Address.IsEmpty)
{
builder.AppendFormat("Address: \n{0}\n", Address.ToString());
}
return builder.ToString();
}
}
}