Repository navigation
[AMI-136] Improve EF Core integration and entity configuration - #11
Merged
Merged
Conversation
- AddEfStores accepts any DbContext and validates at startup that the default Identity entities are mapped - Add AddRuntimeAppsAuthenticationEntities<TKey> consolidated model extension (granular methods unchanged) - Run store transactions inside the DbContext execution strategy so retry-on-failure providers work - Detach rolled-back/failed entities from the shared context; read the resend request with AsNoTracking - Scope verification send limits and supersede to CustomPurpose and CustomChannel (adds two nullable columns to AuthenticationVerificationSends) - Add SQLite model, Identity integration, concurrency and execution strategy tests; document providers, limitations and migration impact Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CaSpYnH33eeK89z7wDB5X
IUserManager<TUser> does not expose role membership or password checks; resolve Identity's UserManager<TUser> (same scoped instance) instead. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CaSpYnH33eeK89z7wDB5X
HasConversion<string>() records the provider type without a ValueConverter instance, so GetValueConverter() is null on the design-time model. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CaSpYnH33eeK89z7wDB5X
…services Other registrations (for example DataProtection) also add IHostedService. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CaSpYnH33eeK89z7wDB5X
hifeamin
commented
Nov 22, 2026
| /// <c>AddRefreshTokenEntity</c> and <c>AddVerificationRequestEntity</c> methods remain available. | ||
| /// Table names or schemas can be overridden afterwards with standard EF Core fluent calls. | ||
| /// </summary> | ||
| public static ModelBuilder AddRuntimeAppsAuthenticationEntities<TKey>( |
Collaborator
Author
There was a problem hiding this comment.
Remove this function.
Old AddRefereshTokenEntity and AddVerificationRequestEntity is ok.
There is no rule that one of them must be selected
Collaborator
Author
There was a problem hiding this comment.
Removed AddRuntimeAppsAuthenticationEntities and its options class. Samples, tests and README now use the granular AddRefreshTokenEntity / AddVerificationRequestEntity methods only. Not compiled or run on my side yet.
Generated by Claude Code
Per review: AddRefreshTokenEntity and AddVerificationRequestEntity stay as the only model configuration methods; no feature has to be selected. Samples, tests and README go back to / use the granular methods. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CaSpYnH33eeK89z7wDB5X
hifeamin
marked this pull request as ready for review
November 22, 2026 20:29
hifeamin
deleted the
feature/7-improve-ef-core-integration-and-entity
branch
November 22, 2026 20:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements AMI-136.
Summary
AddEfStoresnow accepts anyDbContext; a startup validator fails fast with a clear message if the default Identity entities are not mapped.modelBuilder.AddRuntimeAppsAuthenticationEntities<TKey>(features => features.UseRefreshTokens().UseVerificationRequests()). Granular methods are unchanged and produce the same model.TryRotateAsync,TryCreateAsync,TryResendAsync) run inside the DbContext execution strategy, soEnableRetryOnFailureproviders work.TryResendAsyncreads withAsNoTracking.CustomPurpose/CustomChannel.Security considerations
Breaking changes / migration
nvarchar(128)columns (CustomPurpose,CustomChannel) onAuthenticationVerificationSends. Add a migration; existing rows stayNULL. Indexes unchanged.AddEfStoresconstraint is relaxed (source- and binary-compatible).Testing
Not executed. Written in an environment without a .NET SDK, so neither the build nor the new SQLite tests (model, Identity round-trips, concurrent rotation, lockout, resend cooldown, custom purposes, retrying execution strategy) have been run. Opened as a draft until
dotnet buildanddotnet testpass locally.Known limitations
Generated by Claude Code