forked from EgonRasmussen/RealEstateAppExercise
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeedingRepository.txt
More file actions
82 lines (80 loc) · 3.26 KB
/
SeedingRepository.txt
File metadata and controls
82 lines (80 loc) · 3.26 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
private void LoadProperties()
{
_properties = new List<Property>
{
new Property
{
Id = "property_1", Address = "28 Anzac Ave, Collaroy NSW 2097 Australia",
Description =
"This lovely house has 180 degree ocean views and features state of the art appliances.",
Beds = 3, Baths = 1, Parking = 1, LandSize = 500, Price = 600000, AgentId = "agent_2",
ImageUrls = GetPropertyImageUrls(1),
Latitude = -33.739499, Longitude = 151.300683
},
new Property
{
Id = "property_2", Address = "1011 Pittwater Rd, Collaroy NSW 2097 Australia",
Description =
"Situated in a prime location close to shops, this property represents excellent value for money.",
Beds = 4, Baths = 2, Parking = 3, LandSize = 620, Price = 750000, AgentId = "agent_2",
ImageUrls = GetPropertyImageUrls(2),
Latitude = -33.737897, Longitude = 151.302152
},
new Property
{
Id = "property_3", Address = "38 Ocean Grove, Collaroy NSW 2097 Australia",
Description = "This near new architecturally designed house is a unique offering in the area.",
Beds = 2, Baths = 2, Parking = 1, LandSize = 300, Price = 825000, AgentId = "agent_2",
ImageUrls = GetPropertyImageUrls(3),
Latitude = -33.737574, Longitude = 151.300586
},
new Property
{
Id = "property_4", Address = "28 Jenkins St, Collaroy NSW 2097 Australia",
Description =
"Located in one of the most sought after streets in the area, this charming house has a lot going for it.",
Beds = 3, Baths = 1, Parking = 3, LandSize = 450, Price = 480000, AgentId = "agent_1",
ImageUrls = GetPropertyImageUrls(4),
Latitude = -33.729635, Longitude = 151.298172
},
new Property
{
Id = "property_5", Address = "41 Alexander St, Collaroy NSW 2097 Australia",
Description = "Newly renovated house in great location close to the beach.",
Beds = 1, Baths = 1, Parking = 1, LandSize = 370, Price = 610000, AgentId = "agent_1",
ImageUrls = GetPropertyImageUrls(5),
Latitude = -33.732073, Longitude = 151.297265
}
};
}
private void LoadAgents()
{
_agents = new List<Agent>
{
new Agent
{
Id = "agent_2",
Email = "sarah@realestate.com",
Name = "Sarah Brown",
Phone = "555 675 1456",
ImageUrl = $"{GlobalSettings.Instance.ImageBaseUrl}agent_2.png"
},
new Agent
{
Id = "agent_1",
Email = "bob@realestate.com",
Name = "Bob Smith",
Phone = "555 123 1234",
ImageUrl = $"{GlobalSettings.Instance.ImageBaseUrl}agent_1.png"
}
};
}
private List<string> GetPropertyImageUrls(int index)
{
return new List<string>
{
$"{GlobalSettings.Instance.ImageBaseUrl}house_{index}.jpg",
$"{GlobalSettings.Instance.ImageBaseUrl}kitchen_{index}.jpg",
$"{GlobalSettings.Instance.ImageBaseUrl}bed_{index}.jpg"
};
}