public virtual void DeleteByPost(long postId) { List <ContentAttachment> attachments = this.GetAttachmentsByPost(postId); foreach (ContentAttachment attachment in attachments) { Img.DeleteImgAndThumb(attachment.FileUrl); } ContentAttachment.deleteBatch("PostId=" + postId); }