Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • ianhoughton 281 posts 605 karma points c-trib
    Jun 30, 2021 @ 08:35
    ianhoughton
    0

    Issue getting orders with OrderService.SearchOrders

    I'm searching for orders with this code:

    var orders = _orderService.SearchOrders(
                    (where) => where
                        .FromStore(Guid.Parse("5C51ACAA-484E-4B4B-AE12-846B1699AA06")));
    

    but it's throwing this error:

    An item with the same key has already been added

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 30, 2021 @ 09:15
    Matt Brailsford
    0

    Hi Ian,

    Do you have a stack trace?

    Matt

  • ianhoughton 281 posts 605 karma points c-trib
    Jun 30, 2021 @ 09:40
    ianhoughton
    0

    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)

    at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at Vendr.Core.Persistence.Repositories.OrderRepository.AssignOrderLinesRecursive(OrderState order, OrderLineState parentOrderLine, List1 allOrderLines, List1 allOrderLinePriceAdjustments, List1 allOrderLineProperties, List1 allOrderLineAttributes) at Vendr.Core.Persistence.Repositories.OrderRepository.DoProcessDtos(IEnumerable1 dtos) at Vendr.Core.Persistence.Repositories.OrderRepository.Search(IQuerySpecification1 query, ISortSpecification1 sort, Int64 currentPage, Int64 itemsPerPage) at Vendr.Core.Services.OrderService.SearchOrders(IQuerySpecification1 query, ISortSpecification1 sort, Int64 currentPage, Int64 itemsPerPage) at Vendr.Core.Services.OrderService.SearchOrders(IQuerySpecification1 query, Int64 currentPage, Int64 itemsPerPage) at Vendr.Core.Services.OrderService.SearchOrders(Func2 query, Int64 currentPage, Int64 itemsPerPage)

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 30, 2021 @ 09:52
    Matt Brailsford
    100

    Hmm, the only thing I could potentially attribute that to is that you have a duplicate property value trying to be added for some reason. That's the only dictionary that seems to get modified within that method.

    Do you have duplicate property keys per chance? maybe with different casing?

    Matt

  • ianhoughton 281 posts 605 karma points c-trib
    Jun 30, 2021 @ 12:09
    ianhoughton
    0

    Hi Matt,

    I think its some duff data in the database. Running against a copy of the live database I don't see the issue.

    Sorry for wasting your time!!

Please Sign in or register to post replies

Write your reply to:

Draft