public int InsertFeaturedBrandInCategory(int brandId, int categoryId) { CategoryFeaturedBrand newRow = new CategoryFeaturedBrand(); newRow.CategoryId = categoryId; newRow.BrandId = brandId; newRow.Priority = 0; int id = _categoryFeaturedBrandRepository.Create(newRow); return(id); }
public void DeleteFeaturedBrandListInCategory(int categoryId, IList <int> brandIdList) { for (int i = 0; i < brandIdList.Count; i++) { int brandId = brandIdList[i]; CategoryFeaturedBrand fb = _categoryFeaturedBrandRepository.Table.FirstOrDefault(s => s.CategoryId == categoryId && s.BrandId == brandId); if (fb != null) { _categoryFeaturedBrandRepository.Delete(fb); } } }