You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment with an EF database aspire integration you can use a method like 'builder.AddCosmosDbContext' (link) to register the dbContext for DI. It would be nice if there was a similar 'AddCosmosDbContextFactory' method.
It's often handy to have a factory in situations where you want to control the lifetime a bit more tightly to a method rather than at the service level (like where that service is consumed by something long running like a signalR connection, perhaps Blazor server).
As an aside, if you register the cosomos dbContext without the aspire extension method (and use 'enrich' after), what do you provide for the 'TokenCrediential' argument in the context of an Aspire app (assuming it's not using the key like it did previously)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment with an EF database aspire integration you can use a method like 'builder.AddCosmosDbContext' (link) to register the dbContext for DI. It would be nice if there was a similar 'AddCosmosDbContextFactory' method.
It's often handy to have a factory in situations where you want to control the lifetime a bit more tightly to a method rather than at the service level (like where that service is consumed by something long running like a signalR connection, perhaps Blazor server).
As an aside, if you register the cosomos dbContext without the aspire extension method (and use 'enrich' after), what do you provide for the 'TokenCrediential' argument in the context of an Aspire app (assuming it's not using the key like it did previously)?
Beta Was this translation helpful? Give feedback.
All reactions