forked from ddrilling/AsbCloudServer
fix nullable warnings AsbCloudDbContext
This commit is contained in:
parent
12ff470d5f
commit
5f6dae1ea6
@ -345,14 +345,15 @@ namespace AsbCloudDb.Model
|
||||
FillData(modelBuilder);
|
||||
}
|
||||
|
||||
public Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token = default)
|
||||
public Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token)
|
||||
where TEntity : class
|
||||
{
|
||||
var materializedViewName = Set<TEntity>().EntityType.GetViewName();
|
||||
return RefreshMaterializedViewAsync(materializedViewName!, token);
|
||||
var materializedViewName = Set<TEntity>().EntityType.GetViewName()
|
||||
?? throw new System.Exception($"RefreshMaterializedViewAsync<{typeof(TEntity).Name}>(..) db table for this type does not found.");
|
||||
return RefreshMaterializedViewAsync(materializedViewName, token);
|
||||
}
|
||||
|
||||
public Task<int> RefreshMaterializedViewAsync(string materializedViewName, CancellationToken token = default)
|
||||
public Task<int> RefreshMaterializedViewAsync(string materializedViewName, CancellationToken token)
|
||||
{
|
||||
var sql = $"REFRESH MATERIALIZED VIEW {materializedViewName};";
|
||||
return Database.ExecuteSqlRawAsync(sql, token);
|
||||
|
@ -56,8 +56,8 @@ namespace AsbCloudDb.Model
|
||||
|
||||
DatabaseFacade Database { get; }
|
||||
|
||||
Task<int> RefreshMaterializedViewAsync(string? mwName = null, CancellationToken token = default);
|
||||
Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token = default) where TEntity : class;
|
||||
Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token);
|
||||
Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token) where TEntity : class;
|
||||
int SaveChanges();
|
||||
int SaveChanges(bool acceptAllChangesOnSuccess);
|
||||
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
|
||||
|
Loading…
Reference in New Issue
Block a user