private void importPrivate(long startId, long endId) { IList clist = ndb.find(commentType, "Id>=" + startId + " and Id<=" + endId + " order by Id asc").list(); logger.Info("old comment count=" + clist.Count); foreach (IComment x in clist) { // 如果已经导入,那么就删除已有的OpenComment OpenComment oc = hasImport(x); if (oc != null) { deleteOpenComment(oc); deleteTransLog(oc); } OpenComment comment = getOpenComment(x); OpenCommentService service = ObjectContext.Create <OpenCommentService>(); service.Import(comment); logTransInfo(x, comment); } }
public void Import() { List <TComment> clist = db.findAll <TComment>(); foreach (TComment x in clist) { // 如果已经导入,那么就删除已有的OpenComment OpenComment oc = hasImport(x); if (oc != null) { deleteOpenComment(oc); deleteTransLog(oc); } OpenComment comment = getOpenComment(x); OpenCommentService service = ObjectContext.Create <OpenCommentService>(); service.Import(comment); logTransInfo(x, comment); } }