forked from ddrilling/AsbCloudServer
Fix CrudWellRelated*Repository.. Get* method returns nonNullable values.
This commit is contained in:
parent
fda5385e46
commit
eb18d73dd0
@ -20,7 +20,7 @@ namespace AsbCloudApp.Services
|
|||||||
/// <param name="idWell">id скважины</param>
|
/// <param name="idWell">id скважины</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns>emptyList if nothing found</returns>
|
/// <returns>emptyList if nothing found</returns>
|
||||||
Task<IEnumerable<Tdto>?> GetByIdWellAsync(int idWell, CancellationToken token);
|
Task<IEnumerable<Tdto>> GetByIdWellAsync(int idWell, CancellationToken token);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Получение всех записей по нескольким скважинам
|
/// Получение всех записей по нескольким скважинам
|
||||||
@ -28,7 +28,7 @@ namespace AsbCloudApp.Services
|
|||||||
/// <param name="idsWells">id скважин</param>
|
/// <param name="idsWells">id скважин</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns>emptyList if nothing found</returns>
|
/// <returns>emptyList if nothing found</returns>
|
||||||
Task<IEnumerable<Tdto>?> GetByIdWellAsync(IEnumerable<int> idsWells, CancellationToken token);
|
Task<IEnumerable<Tdto>> GetByIdWellAsync(IEnumerable<int> idsWells, CancellationToken token);
|
||||||
}
|
}
|
||||||
#nullable disable
|
#nullable disable
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
public CrudWellRelatedCacheRepositoryBase(IAsbCloudDbContext context, IMemoryCache memoryCache, Func<DbSet<TEntity>, IQueryable<TEntity>> makeQuery)
|
public CrudWellRelatedCacheRepositoryBase(IAsbCloudDbContext context, IMemoryCache memoryCache, Func<DbSet<TEntity>, IQueryable<TEntity>> makeQuery)
|
||||||
: base(context, memoryCache, makeQuery) { }
|
: base(context, memoryCache, makeQuery) { }
|
||||||
|
|
||||||
public async Task<IEnumerable<TDto>?> GetByIdWellAsync(int idWell, CancellationToken token)
|
public async Task<IEnumerable<TDto>> GetByIdWellAsync(int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
var cache = await GetCacheAsync(token);
|
var cache = await GetCacheAsync(token);
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
return dtos;
|
return dtos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<TDto>?> GetByIdWellAsync(IEnumerable<int> idsWells, CancellationToken token)
|
public async Task<IEnumerable<TDto>> GetByIdWellAsync(IEnumerable<int> idsWells, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!idsWells.Any())
|
if (!idsWells.Any())
|
||||||
return Enumerable.Empty<TDto>();
|
return Enumerable.Empty<TDto>();
|
||||||
|
@ -20,7 +20,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
public CrudWellRelatedRepositoryBase(IAsbCloudDbContext context, Func<DbSet<TEntity>, IQueryable<TEntity>> makeQuery)
|
public CrudWellRelatedRepositoryBase(IAsbCloudDbContext context, Func<DbSet<TEntity>, IQueryable<TEntity>> makeQuery)
|
||||||
: base(context, makeQuery) { }
|
: base(context, makeQuery) { }
|
||||||
|
|
||||||
public async Task<IEnumerable<TDto>?> GetByIdWellAsync(int idWell, CancellationToken token)
|
public async Task<IEnumerable<TDto>> GetByIdWellAsync(int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
var entities = await GetQuery()
|
var entities = await GetQuery()
|
||||||
.Where(e => e.IdWell == idWell)
|
.Where(e => e.IdWell == idWell)
|
||||||
@ -29,7 +29,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
return dtos;
|
return dtos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<TDto>?> GetByIdWellAsync(IEnumerable<int> idsWells, CancellationToken token)
|
public async Task<IEnumerable<TDto>> GetByIdWellAsync(IEnumerable<int> idsWells, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!idsWells.Any())
|
if (!idsWells.Any())
|
||||||
return Enumerable.Empty<TDto>();
|
return Enumerable.Empty<TDto>();
|
||||||
|
Loading…
Reference in New Issue
Block a user