public static void DeleteAndSubmit <T>(this IRepository2 <T> repository, IEnumerable <T> objList) where T : class { foreach (var obj in objList) { repository.Delete(obj); } repository.SubmitChanges(); }
/// <summary> /// Deletes a product specification attribute mapping /// </summary> /// <param name="productSpecificationAttribute">Product specification attribute</param> public virtual void DeleteProductSpecificationAttribute(ProductSpecificationAttribute productSpecificationAttribute) { if (productSpecificationAttribute == null) { throw new ArgumentNullException("productSpecificationAttribute"); } _productSpecificationAttributeRepository.Delete(productSpecificationAttribute); _cacheManager.RemoveByPattern(PRODUCTSPECIFICATIONATTRIBUTE_PATTERN_KEY); //event notification _eventPublisher.EntityDeleted(productSpecificationAttribute); }
/// <summary> /// Deletes a specification attribute option /// </summary> /// <param name="specificationAttributeOption">The specification attribute option</param> public virtual void DeleteSpecificationAttributeOption(SpecificationAttributeOption specificationAttributeOption) { if (specificationAttributeOption == null) { throw new ArgumentNullException("specificationAttributeOption"); } _specificationAttributeOptionRepository.Delete(specificationAttributeOption); _cacheManager.RemoveByPattern(PRODUCTSPECIFICATIONATTRIBUTE_PATTERN_KEY); //event notification _eventPublisher.EntityDeleted(specificationAttributeOption); }
public static void DeleteAndSubmit <T>(this IRepository2 <T> repository, T obj) where T : class { repository.Delete(obj); repository.SubmitChanges(); }