Skip to content

Commit b90189d

Browse files
authored
Technical Change Request in OrderService simplcommerce#926 (simplcommerce#927)
1 parent b8e3d17 commit b90189d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ public async Task<Result<Order>> CreateOrder(long cartId, string paymentMethod,
144144
var cart = _cartRepository
145145
.Query()
146146
.Include(c => c.Items).ThenInclude(x => x.Product)
147+
.Include(c => c.Customer)
148+
.Include(c => c.CreatedBy)
147149
.Where(x => x.Id == cartId).FirstOrDefault();
148150

149151
if (cart == null)
@@ -193,9 +195,9 @@ public async Task<Result<Order>> CreateOrder(long cartId, string paymentMethod,
193195

194196
var order = new Order
195197
{
196-
CustomerId = cart.CustomerId,
198+
Customer = cart.Customer,
197199
CreatedOn = DateTimeOffset.Now,
198-
CreatedById = cart.CreatedById,
200+
CreatedBy = cart.CreatedBy,
199201
LatestUpdatedOn = DateTimeOffset.Now,
200202
LatestUpdatedById = cart.CreatedById,
201203
BillingAddress = orderBillingAddress,

0 commit comments

Comments
 (0)