public virtual void RemoveCategory(Category category) { var productCategory = ProductCategories .Where(pc => pc.Category.Id == category.Id) .SingleOrDefault(); if (productCategory == null) return; ProductCategories.Remove(productCategory); }