@@ -24,6 +24,7 @@ public static async Task SeedAsync(IApplicationBuilder applicationBuilder, ILogg
2424 {
2525 await SetIndexes ( ) ;
2626 await SetUSLocations ( ) ;
27+ await SetBarcelonaLocations ( ) ;
2728 }
2829 }
2930
@@ -81,6 +82,20 @@ static async Task SetRedmondLocations(string parentId)
8182 await ctx . Locations . InsertOneAsync ( rdm ) ;
8283 }
8384
85+ static async Task SetBarcelonaLocations ( )
86+ {
87+ var bcn = new Locations ( )
88+ {
89+ Code = "BCN" ,
90+ Description = "Barcelona" ,
91+ LocationId = 5
92+ } ;
93+ bcn . SetLocation ( 2.156453 , 41.395226 ) ;
94+ bcn . SetArea ( GetBarcelonaPoligon ( ) ) ;
95+ await ctx . Locations . InsertOneAsync ( bcn ) ;
96+ }
97+
98+
8499 static async Task SetIndexes ( )
85100 {
86101 // Set location indexes
@@ -141,5 +156,17 @@ static List<GeoJson2DGeographicCoordinates> GetWashingtonPoligon()
141156 new GeoJson2DGeographicCoordinates ( - 124.68633 , 48.8943 )
142157 } ;
143158 }
159+
160+ static List < GeoJson2DGeographicCoordinates > GetBarcelonaPoligon ( )
161+ {
162+ return new List < GeoJson2DGeographicCoordinates > ( )
163+ {
164+ new GeoJson2DGeographicCoordinates ( 2.113741 , 41.419068 ) ,
165+ new GeoJson2DGeographicCoordinates ( 2.188778 , 41.451153 ) ,
166+ new GeoJson2DGeographicCoordinates ( 2.235266 , 41.418033 ) ,
167+ new GeoJson2DGeographicCoordinates ( 2.137101 , 41.299536 ) ,
168+ new GeoJson2DGeographicCoordinates ( 2.033879 , 41.383858 )
169+ } ;
170+ }
144171 }
145172}
0 commit comments