@@ -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
@@ -85,6 +86,20 @@ static async Task SetRedmondLocations(string parentId)
8586 await ctx . Locations . InsertOneAsync ( rdm ) ;
8687 }
8788
89+ static async Task SetBarcelonaLocations ( )
90+ {
91+ var bcn = new Locations ( )
92+ {
93+ Code = "BCN" ,
94+ Description = "Barcelona" ,
95+ LocationId = 5
96+ } ;
97+ bcn . SetLocation ( 2.156453 , 41.395226 ) ;
98+ bcn . SetArea ( GetBarcelonaPoligon ( ) ) ;
99+ await ctx . Locations . InsertOneAsync ( bcn ) ;
100+ }
101+
102+
88103 static async Task SetIndexes ( )
89104 {
90105 // Set location indexes
@@ -145,5 +160,18 @@ static List<GeoJson2DGeographicCoordinates> GetWashingtonPoligon()
145160 new GeoJson2DGeographicCoordinates ( - 124.68633 , 48.8943 )
146161 } ;
147162 }
163+
164+ static List < GeoJson2DGeographicCoordinates > GetBarcelonaPoligon ( )
165+ {
166+ return new List < GeoJson2DGeographicCoordinates > ( )
167+ {
168+ new GeoJson2DGeographicCoordinates ( 2.033879 , 41.383858 ) ,
169+ new GeoJson2DGeographicCoordinates ( 2.113741 , 41.419068 ) ,
170+ new GeoJson2DGeographicCoordinates ( 2.188778 , 41.451153 ) ,
171+ new GeoJson2DGeographicCoordinates ( 2.235266 , 41.418033 ) ,
172+ new GeoJson2DGeographicCoordinates ( 2.137101 , 41.299536 ) ,
173+ new GeoJson2DGeographicCoordinates ( 2.033879 , 41.383858 )
174+ } ;
175+ }
148176 }
149177}
0 commit comments