London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
I think it was an overlook (aka a bug). I will file a bug to commerce team. thanks for bringing this into our attention
@Christian, good catch. The only solution I see until the bug is resolved is create an override of DefaultOrderSearchAsyncService or replace custom implementation of IOrderSearchAsyncService and copy the existing implementation code and adjust it to your need. Or else you can try adding a code interception.
Given the following interface from optimizely:
namespace EPiServer.Commerce.Order { /// <summary>Filter class used to filter which orders to retrieve.</summary> public class OrderSearchFilter { ... /// <summary> /// Specifies that only carts/orders created by specified customer should be returned. /// </summary> public Guid CustomerId { get; set; } ... } }
I would expect it to be possible to search for carts in the the order repository using IOrderSearchAsyncService by doing the following:
var searchFilter = new OrderSearchFilter{CustomerId = currentCustomer.OrganizationId}; var searchResults = await orderSearchAsyncService.SearchAsync<ICart>(null, searchFilter, default);
The observed result is that all carts are returned, regardless of their CustomerId being different.
Is this the intended behaviour?