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

Return value types from DbConnectionFactory methods #186

Open
magnusbakken opened this issue Oct 21, 2019 · 2 comments
Open

Return value types from DbConnectionFactory methods #186

magnusbakken opened this issue Oct 21, 2019 · 2 comments
Assignees

Comments

@magnusbakken
Copy link

I'm just wondering why the return value from the CreatePersistent overloads on Effort.DbConnectionFactory is DbConnection while the return value from CreateTransient is EffortConnection. I can see that (at least in my case) the return value from CreatePersistent is also an EffortConnection, so downcasting manually is possible, but why aren't the return types the same? Is the object returned from CreatePersistent sometimes not an EffortConnection?

@JonathanMagnan JonathanMagnan self-assigned this Oct 21, 2019
@JonathanMagnan
Copy link
Member

Hello @magnusbakken ,

CreateTransient was originally returning a DbConnection but we modified it to EffortConnection since we added a few options on it.

I don't think there is any reason why CreatePersistent doesn't return yet an EffortConnection besides that we missed to do it when we have done the CreateTransient.

We will look at it.

Best Regards,

Jonathan


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

@JonathanMagnan
Copy link
Member

Hello @magnusbakken ,

The v2.2.5 has been released

The CreatePersistent method now also return an EffortConnection.

Let me know if everything now works as expected.

Best Regards,

Jon

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

No branches or pull requests

2 participants