final fix

This commit is contained in:
Mark van der Wal 2020-04-08 12:20:13 +02:00
parent cb892e9192
commit 81218ec0d0

View File

@ -60,12 +60,11 @@ namespace FarmmapsApi.Services
List<Item> items = await _farmmapsApiService.GetItemChildrenAsync(zipItem.Code, List<Item> items = await _farmmapsApiService.GetItemChildrenAsync(zipItem.Code,
SHAPE_PROCESSED_ITEMTYPE); SHAPE_PROCESSED_ITEMTYPE);
if (items.Count(i => i.Created >= startUpload) > 0) items = items.Where(i => i.Created >= startUpload).OrderByDescending(i => i.Created).ToList();
{
shapeItem = items.Where(i => i.Name.Contains(itemName))
.OrderByDescending(i => i.Created)
.First();
if (items.Any())
{
shapeItem = items.First(i => i.Name.Contains(itemName));
if(shapeItem != null) if(shapeItem != null)
{ {
source.Cancel(); source.Cancel();