public async Task Update(IMetricCollector collector, bool disableBatching, bool async)
        {
            using (var context = _fixture.CreateContext(disableBatching))
            {
                using (context.Database.BeginTransaction())
                {
                    foreach (var customer in context.Customers)
                    {
                        customer.FirstName += " Modified";
                    }

                    collector.StartCollection();
                    var records = async
                        ? await context.SaveChangesAsync()
                        : context.SaveChanges();

                    collector.StopCollection();

                    Assert.Equal(1000, records);
                }
            }
        }
Beispiel #2
0
 public void Dispose() => _collector.StopCollection();
Beispiel #3
0
 public void Configure(IApplicationBuilder app, IMetricCollector collector)
 {
     collector.StopCollection();
 }