forked from ddrilling/AsbCloudServer
ArgumentInvalidException
This commit is contained in:
parent
73f2fe0826
commit
15fdfa11ed
@ -34,7 +34,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
public async Task<IEnumerable<WellFinalDocumentDBDto>> UpdateRangeAsync(int idWell, IEnumerable<WellFinalDocumentInputDto>? dtos, CancellationToken token)
|
public async Task<IEnumerable<WellFinalDocumentDBDto>> UpdateRangeAsync(int idWell, IEnumerable<WellFinalDocumentInputDto>? dtos, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (dtos is null)
|
if (dtos is null)
|
||||||
throw new ArgumentInvalidException("Данные по категориям отсутствуют.");
|
throw new ArgumentInvalidException("Данные по категориям отсутствуют.", nameof(dtos));
|
||||||
|
|
||||||
var entities = dtos
|
var entities = dtos
|
||||||
.Where(dto => dto.IdsPublishers?.Any() == true)
|
.Where(dto => dto.IdsPublishers?.Any() == true)
|
||||||
@ -130,7 +130,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
.FirstOrDefaultAsync(x => x.IdWell == idWell && x.IdCategory == idCategory && x.IdUser == idUser, token);
|
.FirstOrDefaultAsync(x => x.IdWell == idWell && x.IdCategory == idCategory && x.IdUser == idUser, token);
|
||||||
|
|
||||||
if (entity is null)
|
if (entity is null)
|
||||||
throw new ArgumentInvalidException("Пользователь не является ответственным за загрузку файла для данной категории.");
|
throw new ArgumentInvalidException("Пользователь не является ответственным за загрузку файла для данной категории.", nameof(entity));
|
||||||
|
|
||||||
var dto = Convert(entity);
|
var dto = Convert(entity);
|
||||||
return dto;
|
return dto;
|
||||||
|
Loading…
Reference in New Issue
Block a user