EntityFramework-Effort icon indicating copy to clipboard operation
EntityFramework-Effort copied to clipboard

Return value types from DbConnectionFactory methods

Open magnusbakken opened this issue 6 years ago • 2 comments

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?

magnusbakken avatar Oct 21 '19 15:10 magnusbakken

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 avatar Oct 21 '19 17:10 JonathanMagnan

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

JonathanMagnan avatar Oct 25 '19 10:10 JonathanMagnan