This commit is contained in:
2021-09-06 22:35:42 +00:00
parent 8015c4e6d8
commit a1e936c3c1
3 changed files with 3 additions and 3 deletions

View File

@@ -313,7 +313,7 @@ namespace AyaNova.Api.Controllers
return StatusCode(403, new ApiNotAuthorizedResponse()); return StatusCode(403, new ApiNotAuthorizedResponse());
// if (!ModelState.IsValid) // if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState)); // return BadRequest(new ApiErrorResponse(ModelState));
var o = await ct.Part.AsNoTracking().Select(x => x.UnitOfMeasure).Distinct().OrderBy(x => x).ToListAsync(); var o = await ct.Part.AsNoTracking().Select(x => x.UnitOfMeasure).Where(x => x != null).Distinct().OrderBy(x => x).ToListAsync();
if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND)); if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
return Ok(ApiOkResponse.Response(o)); return Ok(ApiOkResponse.Response(o));
} }

View File

@@ -182,7 +182,7 @@ namespace AyaNova.Biz
// //
internal async Task<List<string>> GetPriorUnitsAsync() internal async Task<List<string>> GetPriorUnitsAsync()
{ {
return await ct.ServiceRate.AsNoTracking().Select(x => x.Unit).Distinct().OrderBy(x => x).ToListAsync(); return await ct.ServiceRate.AsNoTracking().Select(x => x.Unit).Where(x => x != null).Distinct().OrderBy(x => x).ToListAsync();
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -182,7 +182,7 @@ namespace AyaNova.Biz
// //
internal async Task<List<string>> GetPriorUnitsAsync() internal async Task<List<string>> GetPriorUnitsAsync()
{ {
return await ct.TravelRate.AsNoTracking().Select(x => x.Unit).Distinct().OrderBy(x => x).ToListAsync(); return await ct.TravelRate.AsNoTracking().Select(x => x.Unit).Where(x => x != null).Distinct().OrderBy(x => x).ToListAsync();
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////