public void RemoveContents(IEnumerable <int> ids, UserIdentity userIdentity) { var contentsToRemove = ContentBiz.Read(a => ids.Contains(a.Id) && a.AuthorId == userIdentity.UserId); HashSet <string> pictureNamesToRemove = new HashSet <string>(); foreach (var content in contentsToRemove) { ContentBiz.Remove(content); } UnitOfWork.SaveChanges(); }