/// <summary> /// Get 10.000 rows using Entity Framework /// </summary> static void GetThousands() { using (var profiler = new Framework.Core.MiniProfiler("Test_EF")) { using (var context = new RepoEntities()) { var items = context.TB_Person.ToList(); } var total = profiler.GetElapsedTime(); Console.WriteLine($"Elapsed time using Entity (SELECT): {total}"); } }
/// <summary> /// Insert 10.000 rows using EF(EDMX) /// </summary> static void InsertThousands2() { var items = GetMockedData(10000); using (var profiler = new Framework.Core.MiniProfiler("Test_EF")) { using (var context = new RepoEntities()) { foreach (var item in items) { context.TB_Person.Add(item); } context.SaveChanges(); } var total = profiler.GetElapsedTime(); Console.WriteLine($"Elapsed time using Entity: {total}"); } }