방지 (1) 썸네일형 리스트형 [c#][Linq][EntityFramework] 메모리 누수 방지를 위한 Skip, Take 사용방법 int totalCount = 0;int amountToSkip = 0;int processAmount = 0;Boolean finished = false; using(var context = new {{DataContext}}()){ totalCount = context.{{테이블}}.Where({{조건절}}).Count(); while (!finished) { resultList = context.{{테이블}} .Where({{조건절}}) .OrderBy({{정렬조건}}) //Skip, Take 사용을 위해 정렬 필수 .Skip(amountToSkip) .Take(1000).ToList(); //Take 수는 적절히 조정 processAmount = resultList.Count; if (result.. 이전 1 다음