Closed
Description
I have the following code:
await using DbContext context = await ContextFactory.CreateDbContextAsync();
await context.SaveChangesAsync();
Giving me this branch coverage:
This is the IL for await context.SaveChangesAsync();
:
// [43 9 - 43 66]
IL_00b3: ldarg.0 // this
IL_00b4: ldfld class MyCompany.MyApplication.Core.Persistence.DbContext valuetype MyCompany.MyApplication.Core.Persistence.Repositories.BaseRepository`2/'<DoSomethingAsync>d__10'<!0/*TEntity*/, !1/*TContract*/>::'<context>5__2'
IL_00b9: ldarg.0 // this
IL_00ba: ldfld string valuetype MyCompany.MyApplication.Core.Persistence.Repositories.BaseRepository`2/'<DoSomethingAsync>d__10'<!0/*TEntity*/, !1/*TContract*/>::key
IL_00bf: call class [System.Runtime]System.Threading.Tasks.Task`1<!0/*TEntity*/> class MyCompany.MyApplication.Core.Persistence.Repositories.BaseRepository`2<!0/*TEntity*/, !1/*TContract*/>::FirstOrDefaultAsync(class MyCompany.MyApplication.Core.Persistence.DbContext, string)
IL_00c4: callvirt instance valuetype [System.Runtime]System.Runtime.CompilerServices.TaskAwaiter`1<!0/*TEntity*/> class [System.Runtime]System.Threading.Tasks.Task`1<!0/*TEntity*/>::GetAwaiter()
IL_00c9: stloc.s V_6