public async Task <bool> SaveResourcesAsync(int languageId, string data)
        {
            try
            {
                if (string.IsNullOrEmpty(data))
                {
                    return(false);
                }

                var lsNamesList =
                    (await _repository.GetResourcesByLanguageIdAsync(languageId)).ToDictionary(x => x.ResourceName, y => y);

                var lrsToUpdateList = new List <LocaleStringResource>();
                var lrsToInsertList = new Dictionary <string, LocaleStringResource>();

                var allResources = JsonConvert.DeserializeObject <Dictionary <string, string> >(data);
                if (allResources.Any())
                {
                    foreach (var item in allResources)
                    {
                        if (lsNamesList.ContainsKey(item.Key))
                        {
                            var lsr = lsNamesList[item.Key];
                            lsr.ResourceValue = item.Value;
                            lrsToUpdateList.Add(lsr);
                        }
                        else
                        {
                            var lsr = new LocaleStringResource {
                                LanguageId = languageId, ResourceName = item.Key, ResourceValue = item.Value
                            };
                            if (lrsToInsertList.ContainsKey(item.Key))
                            {
                                lrsToInsertList[item.Key] = lsr;
                            }
                            else
                            {
                                lrsToInsertList.Add(item.Key, lsr);
                            }
                        }
                    }

                    return(await _repository.SaveResourcesAsync(languageId, lrsToInsertList.Values.ToList(), lrsToUpdateList));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }


            return(true);
        }