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

Add IServiceCollection.Use[DbProviderName]<DbContext> extension methods #25220

Merged
merged 8 commits into from
Jul 22, 2021

Conversation

DamianEdwards
Copy link
Member

@DamianEdwards DamianEdwards commented Jul 8, 2021

Adds extension methods to enable simpler adding and configuration of contexts for a specific EF Core provider, e.g.:

var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddSqlite<ApplicationDbContext>(connectionString);

Contributes to #25192

Todo:

  • Add Sqlite methods
  • Add SQL Server methods
  • Add tests

@DamianEdwards DamianEdwards changed the title Add IServiceCollection.Use[DbProviderName]<DbContext> extension methods Draft: Add IServiceCollection.Use[DbProviderName]<DbContext> extension methods Jul 8, 2021
@DamianEdwards DamianEdwards requested review from JeremyLikness and a team and removed request for a team July 8, 2021 17:39
@DamianEdwards
Copy link
Member Author

Would appreciate some guidance RE testing. I wasn't able to locate any existing tests for methods similar to this so not sure if new tests are expected for thin convenience methods like this or not.

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Jul 8, 2021

You can add some tests to SqlServerDbContextOptionsExtensionsTest / SqliteDbContextOptionsBuilderExtensionsTest.

Note that we are waiting for all team members to get back to work before we review this proposal.

@davidfowl
Copy link
Member

Note that we are waiting for all team members to get back to work before we review this proposal.

What's that ETA like?

@AndriySvyryd
Copy link
Member

What's that ETA like?

At least two weeks

@davidfowl
Copy link
Member

So RC1

@DamianEdwards
Copy link
Member Author

FYI @JunTaoLuo will be taking over the task of completing this PR for rc.1

@JunTaoLuo JunTaoLuo requested a review from AndriySvyryd July 21, 2021 20:14
@JunTaoLuo JunTaoLuo marked this pull request as ready for review July 21, 2021 20:14
@JunTaoLuo
Copy link
Contributor

Flipping to ready to review to finalize the new overload signatures. I'll add tests once the API is more well defined.

@JunTaoLuo JunTaoLuo changed the title Draft: Add IServiceCollection.Use[DbProviderName]<DbContext> extension methods Add IServiceCollection.Use[DbProviderName]<DbContext> extension methods Jul 21, 2021
@AndriySvyryd
Copy link
Member

Looking good

@JunTaoLuo
Copy link
Contributor

This is ready for final review.

@AndriySvyryd
Copy link
Member

@roji @lauxjpn FYI

John Luo and others added 3 commits July 22, 2021 13:09
Co-authored-by: Andriy Svyryd <AndriySvyryd@users.noreply.github.com>
@JunTaoLuo JunTaoLuo self-assigned this Jul 22, 2021
@JunTaoLuo JunTaoLuo merged commit d37ad45 into main Jul 22, 2021
@JunTaoLuo JunTaoLuo deleted the damianedwards/25192 branch July 22, 2021 20:51
@AndriySvyryd
Copy link
Member

@cincuranet @archanasoni FYI

@ErikEJ
Copy link
Contributor

ErikEJ commented Jul 23, 2021

@lauxjpn !

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

Successfully merging this pull request may close these issues.

5 participants