Copied to clipboard

Flag this post as spam?

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


  • robjakedorsett 13 posts 63 karma points
    Sep 02, 2021 @ 10:04
    robjakedorsett
    0

    System.ArgumentException: An item with the same key has already been added.

    Hi Matt, I'm getting the following error when using the _orderService.GetOrder(GUID orderId);

    System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Vendr.Core.Persistence.Repositories.OrderRepository.AssignOrderLinesRecursive(OrderState order, OrderLineState parentOrderLine, List`1 allOrderLines, List`1 allOrderLinePriceAdjustments, List`1 allOrderLineProperties, List`1 allOrderLineAttributes)
       at Vendr.Core.Persistence.Repositories.OrderRepository.DoProcessDtos(IEnumerable`1 dtos)
       at Vendr.Core.Persistence.Repositories.OrderRepository.DoFetchInternal(IDatabaseUnitOfWork uow, String sql, Object[] args)
       at Vendr.Core.Persistence.Repositories.OrderRepository.Get(Guid id)
       at Vendr.Core.Services.OrderService.PerformGetState(Guid id)
       at Vendr.Core.Cache.DefaultEntityStatePolicyCache`2.Get(TId id, Func`2 performGet, Func`2 performGetAll)
       at Vendr.Core.Services.OrderService.GetOrderState(Guid id)
       at Vendr.Core.Services.OrderService.GetOrder(Guid id)
    

    Any ideas on what could be causing this?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 02, 2021 @ 10:12
    Matt Brailsford
    0

    Hi,

    Could you please state which version of Vendr you are using along with any add-ons such as Vendr.Checkout.

  • robjakedorsett 13 posts 63 karma points
    Sep 02, 2021 @ 11:02
    robjakedorsett
    0

    Hi Matt, we are using vendr 1.8.6-beta0007 attached all the vendr packages we have installed, not using Vendr.Checkout

    enter image description here

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 02, 2021 @ 11:10
    Matt Brailsford
    100

    Ok, my best initial guess is that you have 2 order lines properties defined on an order line but potentially their key casing is different. You might need to check your DB for duplicates for the same order line and see if it's a casing thing.

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft