private async Task Commit(CancellationToken cancellationToken, params StoreTypes[] commit) { if (commit == null) { throw new ArgumentNullException(nameof(commit)); } foreach (var i in commit) { switch (i) { case StoreTypes.UserStore: await UserStore.CommitAsync(cancellationToken); break; case StoreTypes.EmailStore: await EmailStore.CommitAsync(cancellationToken); break; case StoreTypes.LockoutStore: await LockoutStore.CommitAsync(cancellationToken); break; case StoreTypes.NameStore: await NameStore.CommitAsync(cancellationToken); break; case StoreTypes.PasswordStore: await PasswordStore.CommitAsync(cancellationToken); break; case StoreTypes.TokenStore: await TokenStore.CommitAsync(cancellationToken); break; case StoreTypes.ClaimStore: await ClaimStore.CommitAsync(cancellationToken); break; default: throw new ArgumentOutOfRangeException(); } } }