so i created a scoped service and kept the middleware. in the middleware i run the scoped service to create transaction and then set the session object into context like this:
context.Items["MongoSession"] = session;
context.Items["MongoSession"] = session;
this is just to play around. what do you think about it?