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

How can we pass our own command runners? #144

Open
vamsidogiparthi opened this issue Mar 6, 2023 · 0 comments
Open

How can we pass our own command runners? #144

vamsidogiparthi opened this issue Mar 6, 2023 · 0 comments

Comments

@vamsidogiparthi
Copy link

I see we have this code in the UpsertCommandBuilder to build the command based on their runners. Is there any way we can pass these runners or replace them with our own IUpsertCommandRunner to actually customize few methods or add few etc on top of the existing ones?

     private IUpsertCommandRunner GetCommandRunner()
        {
            var dbProvider = _dbContext.GetService<IDatabaseProvider>();
            var commandRunner = _dbContext.GetInfrastructure().GetServices<IUpsertCommandRunner>()
                .Concat(DefaultRunners.GetRunners())
                .FirstOrDefault(r => r.Supports(dbProvider.Name));
            if (commandRunner == null)
                throw new NotSupportedException(Resources.DatabaseProviderNotSupportedYet);

            return commandRunner;
        } 

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

No branches or pull requests

1 participant