private static Localization InitializeItem(Localization item, IEnumerable<ImportItem> systemValues) { if (item == null) item = new AppConfigEntityFactory().CreateEntity<Localization>(); var itemProperties = item.GetType().GetProperties(); systemValues.ToList().ForEach(x => SetPropertyValue(item, itemProperties.FirstOrDefault(y => y.Name == x.Name), x.Value)); return item; }
public void Can_Add_Localization() { var client = GetRepository(); var localizationItem = new Localization {LanguageCode = "EN", Name = "1", Value = "Test", Category = "1", }; var items = client.Localizations.ToList(); items.Add(localizationItem); client.Add(localizationItem); client.UnitOfWork.Commit(); var checkRepository = GetRepository(); localizationItem = checkRepository.Localizations.Where(x => x.Name == "1").SingleOrDefault(); Assert.NotNull(localizationItem); }