Intercept from 4.7.2 app when ORM is .NET Standard 2.0

Posts   
 
    
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 21-Jul-2020 23:02:45   

Hi,

I'm migrating ORM from 4.7.2 to .NET Standard 2.0. RuntimeConfiguration setup is done in a class library (aka boostrapper) which is shared among the apps. For .NET Standard 2.0 implementation I have to provide DbProviderFactory - that part is fine, however, to intercept it needs to be wrapped into SD.Tools.OrmProfiler.Interceptor.InterceptorCore.Initialize but I can't seem to be able to reference the .NETCore nuget interceptor from this 4.7.2 class library (suspect it's .NET Core only) and the .NETFull interceptor doesn't provide a wrapper for the factory. Basically, question boils down to: how to intercept from 4.7.2 app when ORM is .NET Standard 2.0 simple_smile

Thank you!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 38664
Joined: 17-Aug-2003
# Posted on: 22-Jul-2020 08:37:42   

We'll look into it

Frans Bouma | Lead developer LLBLGen Pro
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 22-Jul-2020 08:40:31   

Otis wrote:

We'll look into it

Thank you! 👍

Otis avatar
Otis
LLBLGen Pro Team
Posts: 38664
Joined: 17-Aug-2003
# Posted on: 23-Jul-2020 10:12:40   

It indeed requires an overload that's not there. We'll add the overload.

Frans Bouma | Lead developer LLBLGen Pro
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 23-Jul-2020 10:22:36   

Otis wrote:

It indeed requires an overload that's not there. We'll add the overload.

Alright, I'll still migrating meanwhile simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 38664
Joined: 17-Aug-2003
# Posted on: 23-Jul-2020 11:50:56   

We've added the overload, which should be in nuget package v2.0.3 of the netfull interceptor. As soon as nuget adds it to the site you should be able to update your project and use the overload to obtain the wrapped type.

The workaround we internally used (first call InterceptorCore.Initialize to get the types wrapped in the DbProviderFactories table, then call DbProviderFactories.GetFactory().GetType()) doesn't work for you as you share the code with .netstandard projects which don't have a DbProviderFactories table.

Frans Bouma | Lead developer LLBLGen Pro
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 23-Jul-2020 11:53:18   

Otis wrote:

We've added the overload, which should be in nuget package v2.0.3 of the netfull interceptor. As soon as nuget adds it to the site you should be able to update your project and use the overload to obtain the wrapped type.

The workaround we internally used (first call InterceptorCore.Initialize to get the types wrapped in the DbProviderFactories table, then call DbProviderFactories.GetFactory().GetType()) doesn't work for you as you share the code with .netstandard projects which don't have a DbProviderFactories table.

Awesome! I'll wait for the Nuget then simple_smile Thank you!

Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 23-Jul-2020 18:00:14   

One more question: some newer apps use .net standard 2.0 library as a bootstrapper and currently have the .NetFull version installed which is highlighted with a warning rectangle. I'd like to get rid of that and was curious if it's possible to have the interceptor Nuget target .net standard 2.0. Not sure if that's doable though as maybe it needs to be installed/configured from the executing app only as the app actually defines the target platform...

P.S.: 2.0.3 Nuget is available, integrating it now simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 38664
Joined: 17-Aug-2003
# Posted on: 24-Jul-2020 09:44:53   

Not possible, sorry. the net full version requires the table to do its magic, and the .net core version needs .net core specific code afaik.

Frans Bouma | Lead developer LLBLGen Pro
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 24-Jul-2020 09:52:41   

Otis wrote:

Not possible, sorry. the net full version requires the table to do its magic, and the .net core version needs .net core specific code afaik.

Yeah, that's what I suspected, using .NETFull for now, later, it seems like, will have to migrate all bootstrapper class libraries to be .netcore. Thank you!