private static CategoryModel FromCategoryToCategoryModel(Category category) { var categoryModel = new CategoryModel { Id = category.Id, Color = category.Color, Name_Ru = PartnerMapper.GetValue(category.Name, Languages.Ru), Name_En = PartnerMapper.GetValue(category.Name, Languages.En) }; return(categoryModel); }
private static Category FromCategoryModelToCategory(CategoryModel categoryModel) { Category category = new Category { Color = categoryModel.Color, Name = PartnerMapper.SetValue(categoryModel.Name_Ru, categoryModel.Name_En) }; if (categoryModel.Id != null) { category.Id = categoryModel.Id; } return(category); }