We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 985428b commit 1d832a6Copy full SHA for 1d832a6
1 file changed
src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs
@@ -1,6 +1,7 @@
1
using Microsoft.EntityFrameworkCore;
2
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
3
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
4
+using Ordering.Domain.Exceptions;
5
using System;
6
using System.Threading.Tasks;
7
@@ -32,7 +33,8 @@ public Order Add(Order order)
32
33
34
public async Task<Order> GetAsync(int orderId)
35
{
- return await _context.Orders.FindAsync(orderId);
36
+ return await _context.Orders.FindAsync(orderId)
37
+ ?? throw new OrderingDomainException($"Not able to get the order. Reason: no valid orderId: {orderId}");
38
}
39
40
public void Update(Order order)
0 commit comments