public static async Task <int> FindComponentId(this IntegrationTestsFixture fixture, string componentName) { using var scope = fixture.BeginDbContextScope(); var dbContext = scope.Resolve <SheepItDbContext>(); return(await dbContext.Components .Where(component => component.Name == componentName) .Select(component => component.Id) .SingleAsync()); }
public static async Task <int> FindEnvironmentId(this IntegrationTestsFixture fixture, string environmentName) { using var scope = fixture.BeginDbContextScope(); var dbContext = scope.Resolve <SheepItDbContext>(); return(await dbContext.Environments .Where(environment => environment.DisplayName == environmentName) .Select(environment => environment.Id) .SingleAsync()); }