Relative Content

Tag Archive for c#azureentity-frameworkconcurrencyazure-servicebus-queues

Azure Service Bus with a dedicated entity framework dbcontext for each handler in concurrent call

I have azure service bus (I use Azure.Messaging.ServiceBus) with configured MaxConcurrentCalls in receiver (let’s say to 10). I want to make thread safe access to EF dbcontext in the callback and I don’t want creating a new dbcontext in each new call. I also, don’t want to lock the whole callback operation (in this case the whole benefits from MaxConcurrentCalls are disappear). I don’t see more options yet.