We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5831a8 commit 71a93f2Copy full SHA for 71a93f2
NorthwindCRUD/Controllers/OrdersController.cs
@@ -222,9 +222,9 @@ public ActionResult<CustomerDto> GetShipperByOrderId(int id)
222
try
223
{
224
var order = this.orderService.GetById(id);
225
- if (order != null)
+ if (order?.ShipperId != null)
226
227
- var shipper = this.shipperService.GetById(order.ShipVia);
+ var shipper = this.shipperService.GetById(order.ShipperId.Value);
228
229
if (shipper != null)
230
NorthwindCRUD/Services/OrderService.cs
@@ -73,7 +73,7 @@ public OrderDb[] GetOrdersByEmployeeId(int id)
73
public OrderDb[] GetOrdersByShipperId(int id)
74
75
return GetOrdersQuery()
76
- .Where(o => o.ShipVia == id)
+ .Where(o => o.ShipperId == id)
77
.ToArray();
78
}
79
0 commit comments