コード例 #1
0
        private void PoccessTextsPart(OriginalTextRepository originalTextRepository, Entities entities)
        {
            var testsToGenerate = originalTextRepository
                .GetAll(t => t.ProcessedText == null)
                .Take(Config.PollingPartSize)
                .ToList();

            testsToGenerate
                .ForEach(
                    t =>
                    {
                        t.ProcessedText = GenerateMarkovChain(t.Text);
                        t.ProcessedDate = DateTime.Now;
                    }
                );

            entities.SaveChanges();
        }
コード例 #2
0
        private static void PoccessTextsPart(OriginalTextRepository originalTextRepository, Entities entities)
        {
            var testsToGenerate = originalTextRepository
                .GetAll(t => t.ProcessedText == null)
                .Take(10)
                .ToList();

            testsToGenerate
                .ForEach(
                    t =>
                    {
                        t.ProcessedText = "test";
                        t.ProcessedDate = DateTime.Now;
                    }
                );

            entities.SaveChanges();
        }