public void Delete(ArticleImage Obj) { Model.Local.AttributeArticleImageRepository AttributeArticleImageRepository = new AttributeArticleImageRepository(); AttributeArticleImageRepository.DeleteAll(AttributeArticleImageRepository.ListImageArticle(Obj.ImaArt_Id)); Model.Local.CompositionArticleImageRepository CompositionArticleImageRepository = new CompositionArticleImageRepository(); CompositionArticleImageRepository.DeleteAll(CompositionArticleImageRepository.ListImageArticle(Obj.ImaArt_Id)); this.DBLocal.ArticleImage.DeleteOnSubmit(Obj); this.Save(); }
public void DeleteAll(List <ArticleImage> list) { foreach (var Obj in list) { Model.Local.AttributeArticleImageRepository AttributeArticleImageRepository = new AttributeArticleImageRepository(); AttributeArticleImageRepository.DeleteAll(AttributeArticleImageRepository.ListImageArticle(Obj.ImaArt_Id)); Model.Local.CompositionArticleImageRepository CompositionArticleImageRepository = new CompositionArticleImageRepository(); CompositionArticleImageRepository.DeleteAll(CompositionArticleImageRepository.ListImageArticle(Obj.ImaArt_Id)); } this.DBLocal.ArticleImage.DeleteAllOnSubmit(list); this.Save(); }