Example #1
0
        public List <CityLanguageLine> GetCityLanguageLineList(List <City> items)
        {
            var result    = new List <CityLanguageLine>();
            var languages = _repositoryLanguage.Get();
            var dataList  = new CityDatas().CityLanguageLines;

            for (var i = 0; i < items.Count(); i++)
            {
                foreach (var language in languages)
                {
                    var dataListItem = dataList[i].City;
                    var item         = new CityLanguageLine
                    {
                        Id         = Guid.NewGuid(),
                        City       = items.FirstOrDefault(x => x.CityCode == dataListItem.CityCode),
                        Language   = language,
                        CityName   = dataList[i].CityName,
                        CreateDate = DateTime.Now
                    };
                    result.Add(item);
                }
            }

            return(result);
        }
Example #2
0
        public CityLanguageLine AddCityLanguageLine(CityLanguageLine itemLanguageLine)
        {
            var result = _repositoryCityLanguageLine.Add(itemLanguageLine);

            _repositoryCityLanguageLine.SaveChanges();
            return(result);
        }