public static MultiLanguage <string> MergeMultilingualStrings(MultiLanguage <string> first,
                                                                      MultiLanguage <string> second)
        {
            var allFromFirst  = first.GetAll();
            var allFromSecond = second.GetAll();

            var result = new MultiLanguage <string>();

            foreach (var item in allFromSecond)
            {
                if (!string.IsNullOrEmpty(item.value))
                {
                    result.TrySetValue(item.languageCode, item.value);
                }
            }

            foreach (var item in allFromFirst)
            {
                if (!allFromSecond.Contains(item))
                {
                    result.TrySetValue(item.languageCode, item.value);
                }
            }

            return(result);
        }
 public async Task Update(MultiLanguage <List <string> > amenities)
 {
     foreach (var amenity in amenities.GetAll())
     {
         if (amenity.value != null)
         {
             await AddNewAmenitiesToStore(amenity);
         }
     }
 }
        public MultiLanguage <List <string> > Normalize(MultiLanguage <List <string> > amenities)
        {
            var allAmenities        = amenities.GetAll();
            var normalizedAmenities = new MultiLanguage <List <string> >();

            foreach (var amenity in allAmenities.Where(amenity => !string.IsNullOrEmpty(amenity.languageCode)))
            {
                if (amenity.languageCode != Languages.GetLanguageCode(DcLanguages.Arabic))
                {
                    normalizedAmenities.TrySetValue(amenity.languageCode, NormalizeAndSplitAmenities(amenity));
                }
                else
                {
                    normalizedAmenities.TrySetValue(amenity.languageCode, amenity.value);
                }
            }

            return(normalizedAmenities);
        }