您好,我的应用程序中包含一些集成测试。在实例化测试类时,我正在使用以下类准备数据库:
internal static class DatabaseTestPreparation
{
private const string TestDatabaseName = "TestDatabase";
internal static IServiceCollection ConfigureTestDatabases(this IServiceCollection services) =>
services
.PrepareTestDatabaseContext<EventStoreContext>()
.PrepareTestDatabaseContext<GrantContext>();
private static IServiceCollection PrepareTestDatabaseContext<T>(this IServiceCollection services)
where T : DbContext
{
var descriptor = services.SingleOrDefault(service =>
service.ServiceType == typeof(DbContextOptions<T>));
if (!(descriptor is null))
{
services
.Remove(descriptor);
}
services
.AddDbContext<T>(options =>
options.UseInMemoryDatabase(TestDatabaseName))
.Seed<T>();
return services;
}
private static IServiceCollection Seed<T>(this IServiceCollection services) where T : DbContext
{
var serviceProvider = services.BuildServiceProvider();
var dbContext = serviceProvider
.GetService(typeof(T)) as T;
dbContext …Run Code Online (Sandbox Code Playgroud) c# asp.net integration-testing entity-framework-core asp.net-core
我有一个 v-select 组件,如下所示:
<v-select
class="area-select"
v-model="selectedAreas"
multiple
:items="areas"
item-text="label"
item-value="key"
label="Select" />
...
.area-select {
margin-left: 10px;
margin-right: 10px;
width: 280px;
}
Run Code Online (Sandbox Code Playgroud)
正如您所注意到的,它接受多个值。它还设置了一定的宽度。问题是,当我从这个组件中选择太多选项时,它会增加它的高度。我如何包装选择中显示的文本,而不是放大它?谢谢你的帮助。
我需要在特定时间触发托管服务,例如。每天13:00。我的典型 ExecuteAsync 方法似乎是这样的:
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
var interval = _configuration.IntervalInSeconds * 1000;
while (!stoppingToken.IsCancellationRequested)
{
// some job
await Task
.Delay(interval, stoppingToken);
}
}
Run Code Online (Sandbox Code Playgroud)
例如,当应用程序启动时,会调用 executeAsync 方法,然后每分钟都会发生一些操作。现在我必须只在特定时间执行这样的操作。有什么方法可以实现这种行为吗?除了粗略计算下一次触发时间之外,我的问题还有什么解决方案吗??谢谢你的帮助。
谁能解释一下如何将 css 设置为 vuetify 复选框?我想更改字体、大小等,但我不知道如何在样式部分访问它。这是我的复选框:
<v-checkbox
class="type-box"
dense
v-for="type in feedTypeFilterList"
:key="type.name"
v-model="type.isSelected"
:label="type.name"
/>
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助。
asp.net-core ×2
c# ×2
css ×2
javascript ×2
vue.js ×2
vuetify.js ×2
.net-core ×1
asp.net ×1