We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there an easy way to make this work? Overloading breaks runtime DI, using IDbContextFactory<DataContext> ctx inside of HubInterface breaks Tapper.
IDbContextFactory<DataContext> ctx
[Hub] public interface IInventoryHub { Task<Shelf[]> GetShelves(); } public class InventoryHub : Hub<IInventoryReceiver> { public async Task<Shelf[]> GetShelves(IDbContextFactory<DataContext> ctx) { await using var db = await ctx.CreateDbContextAsync(); var shelves = db.Shelves.ToArray(); return shelves; } }
Edit: it is possible to use DI in constructor
public class InventoryHub(IDbContextFactory<DataContext> ctx) : Hub<IInventoryReceiver>, IInventoryHub
and it works, so not big deal
The text was updated successfully, but these errors were encountered:
Currently, dependency injection using method parameters is not supported.
Sorry, something went wrong.
No branches or pull requests
Is there an easy way to make this work? Overloading breaks runtime DI, using
IDbContextFactory<DataContext> ctx
inside of HubInterface breaks Tapper.Edit:
it is possible to use DI in constructor
and it works, so not big deal
The text was updated successfully, but these errors were encountered: