public Task <bool> Delete(int orderId) { //soft delete by setting cancelled property bool found = OrderList.Any(o => (o.Id == orderId) && (!o.Cancelled)); if (found) { OrderList.First(o => o.Id == orderId).Cancelled = true; } return(Task <bool> .FromResult(found)); }