public void SwedenFinlandUpdateCuisines()
{
log.InfoFormat("[SwedenFinlandUpdateCuisines].");
RestaurantsSearch searchUtility = new RestaurantsSearch();
var allRests = searchUtility.FindAllSwedenFinlandRestaurantsWithCusine();
ServiceLayerImpl serviceLayer = new ServiceLayerImpl();
int foundCuisines = 0, notFoundCuisine = 0;
foreach (var rest in allRests)
{
string restName = rest.Name != null ? rest.Name : "";
string restDescription = rest.Description != null ? rest.Description : "";
List<CuisineMap> cuisineMaps = cuisineServices.CuisineMapSearch(rest, "Finland");
if (cuisineMaps != null && cuisineMaps.Count > 0)
{
string cuisinesList = rest.Cuisines != null ? String.Join(", ", rest.Cuisines.ToArray()) : "Empty";
log.InfoFormat("[SwedenFinlandUpdateCuisines] Cuisine found. Cuisines list={0}, Cuisine.Count={1}, Restaurant.Name={2}, Restaurant.Description={3}.", cuisinesList, cuisineMaps.Count, restName, restDescription);
serviceLayer.UpdateRestaurant(rest);
foundCuisines++;
}
else
{
log.InfoFormat("[SwedenFinlandUpdateCuisines] Cuisine not found. Restaurant.Name={0}, Restaurant.Id={1}, Restaurant.Description={2}.", restName, rest.Id.ToString(), restDescription);
notFoundCuisine++;
}
}
log.InfoFormat("[SwedenFinlandUpdateCuisines] foundCuisines={0}, notFoundCuisine={1}, allRests={2}.", foundCuisines, notFoundCuisine, allRests.Count);
}