How to publish event in nservice bus

Hi
I want to call event using below function.

foreach( int iKey in dicEvent.Keys)
                        {
                            IList<PriceReceivedEvent> lstPrice = dicMprEvent[iKey];
                            await context.Publish(new PriceReceivedListEvent() { PriceReceivedEvents = lstPrice.ToList() }).ConfigureAwait(false);
                        }

this class I created for event

  public class PriceReceivedListEvent 
    {
      public  IList<PriceReceivedEvent> PriceReceivedEvents { get; set; }
    }

and trying to call this handler.

     public async Task Handle(PriceReceivedListEvent message, IMessageHandlerContext context)
            {
                IList<PriceReceivedEvent> lstPrices = message.PriceReceivedEvents;
           }

what i am doing wrong. Please suggest.

Most likely it has to do with the subscription/endpoint mapping for that endpoint handling the published event.

@mick24 is probably right. If you post all endpoint configuration available, we might be able to investigate what is missing and provide you with the solution.

Thank for answer, i configured the endpoint and now its working

Good to hear! Thanks for letting us know!