Skip to content
New issue

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

Use GenericRepository with AddDbContextFactory #49

Open
leonardopugliese opened this issue Feb 14, 2024 · 4 comments · May be fixed by #57
Open

Use GenericRepository with AddDbContextFactory #49

leonardopugliese opened this issue Feb 14, 2024 · 4 comments · May be fixed by #57

Comments

@leonardopugliese
Copy link

HI! I use GenericRepository with satisfaction! I would like to use it with Blazor, is it compatible with "AddDbContextFactory" and related changes? Thank you

https://learn.microsoft.com/en-us/ef/core/dbcontext-configuration/#dbcontextoptions

@NotAsea
Copy link

NotAsea commented Feb 21, 2024

As far as i have been used, GenericRepo doesnt really care about what DbContext lifetime as long as there's DbContext in ServiceProvider, i assume it safe to use, but let me have a quick test

@NotAsea
Copy link

NotAsea commented Feb 21, 2024

Update it can't since it expect inject directly DbContext, anyway this lib intends for ASP.NET project, Blazor has wilder lifetime management, hence not much we can rely on right now

dmitrii-kiselev added a commit to dmitrii-kiselev/EFCore.GenericRepository that referenced this issue Sep 24, 2024
@dmitrii-kiselev dmitrii-kiselev linked a pull request Sep 24, 2024 that will close this issue
@dmitrii-kiselev
Copy link

dmitrii-kiselev commented Sep 24, 2024

Hi @leonardopugliese, @NotAsea,

I added IDbContextFactory<TContext> support (#57).
I was waiting for the review and comments from @TanvirArjel.

Best Regards,
Dmitrii Kiselev

@leonardopugliese
Copy link
Author

Great @dmitrii-kiselev !! We hope that the changes can be included soon by @TanvirArjel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants