Re: [nhusers] NHibernate with Microsoft.Extensions.DependencyInjection

2020-11-05 Thread eric....@gmail.com
I implemented this pretty easily, and wrote about it at StackOverflow here 
, if anyone wants to see the 
basic impl (without optimizations that I later added).

On Monday, September 21, 2020 at 1:11:48 PM UTC-4 Danny Van den Wouwer 
wrote:

> Hi,
>
> There isn't much documentation about this interface. And I believe they 
> are internally busy tot replace this interface in he next major version. 
> See issue 1793, 1781.
>
> You van Aldo read in this blog 
>
> https://kozmic.net/2011/03/20/working-with-nhibernate-without-default-constructors/
>
> Vriendelijke groeten,
> Van den Wouwer Danny
>
> Software Engineer
> Peopleware NV
> www.peopleware.be
>
> Op ma 21 sep. 2020 19:04 schreef eric@gmail.com :
>
>> I looked at the implementations in Fabio's uNhAddIns project 
>> , and 
>> implementing IObjectsFactory is simple. But even looking at the NHibernate 
>> source code it's not clear how and when IBytecodeProvider and 
>> IReflectionOptimizer are used. I want to fully understand these interfaces 
>> and how they are used in order to make sure I'm implementing the 
>> MS.Extensions.DI "adapter" correctly and completely.
>> Is there any documentation about those?
>>
>> On Saturday, September 19, 2020 at 7:32:42 AM UTC-4 haz...@gmail.com 
>> wrote:
>>
>>> Unfortunately no one has done this for 
>>> Micorosoft.Extensions.DependencyInjection. What you would need to do is to 
>>> implement IObjectsFactory (check examples from Fabio's blog). There are 
>>> only 3 or 4 methods. 
>>>
>>> Best Regards,
>>> Alexander
>>>
>>> On Fri, Sep 18, 2020 at 1:30 PM Eric Rizzo  wrote:
>>>
 No, not at all. That just covers one pattern for registering the 
 ISession and ISessionFactory so they can be injected into DI-managed 
 services (something I already have). What I need is for NH to use the DI 
 container when creating the pieces it uses under the covers, such as 
 IConnectionProvider.

 Eric


 On Fri, Sep 18, 2020, 3:28 AM Paulo Quicoli  
 wrote:

> Hi
>
> Is this what you are looking for?
>
> https://gunnarpeipman.com/aspnet-core-nhibernate/ 
>
> On Fri, Sep 18, 2020, 07:52 eric@gmail.com  
> wrote:
>
>> Trying to use dependency injection with custom NHibernate 
>> implementation classes, specifically an IConnectionProvider. To be 
>> clear, I have NO interest in using DI with *entities*, just in a 
>> custom impl of a NHibernate interface.
>> I've read the (old) articles (here 
>>  
>> and here 
>> )
>>  
>> and they sound promising, but the implementations are for Autofac, 
>> Spring, 
>> and Castle Windsor. Has nobody ever published an impl for .Net Core's 
>> "default" Microsoft.Extensions.DependencyInjection? I can't believe it 
>> hasn't been done before.
>>
>> Any pointers?
>>
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "nhusers" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to nhusers+u...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/nhusers/e5065fc5-f8d7-4e9d-a9c4-5951404f59fcn%40googlegroups.com
>>  
>> 
>> .
>>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "nhusers" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/nhusers/cdRA62nFo7I/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> nhusers+u...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/nhusers/CAF8vUGU56OEVaptvh6xm%3D%2BwDzTXRb4_q59XRCpN0K5Tt1U5Xkw%40mail.gmail.com
>  
> 
> .
>
 -- 
 You received this message because you are subscribed to the Google 
 Groups "nhusers" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to nhusers+u...@googlegroups.com.

>>> To view this discussion on the web visit 
 https://groups.google.com/d/msgid/nhusers/CAFW84TLNAJp_cFTidKDdnZV-y4SS9-xryXJ7jH8wpwqCPuJcNg%40mail.gmail.com
  
 
 .

>>> -- 
>> You received this 

Re: [nhusers] NHibernate with Microsoft.Extensions.DependencyInjection

2020-09-21 Thread Danny Van den Wouwer
Hi,

There isn't much documentation about this interface. And I believe they are
internally busy tot replace this interface in he next major version. See
issue 1793, 1781.

You van Aldo read in this blog
https://kozmic.net/2011/03/20/working-with-nhibernate-without-default-constructors/

Vriendelijke groeten,
Van den Wouwer Danny

Software Engineer
Peopleware NV
www.peopleware.be

Op ma 21 sep. 2020 19:04 schreef eric@gmail.com :

> I looked at the implementations in Fabio's uNhAddIns project
> , and
> implementing IObjectsFactory is simple. But even looking at the NHibernate
> source code it's not clear how and when IBytecodeProvider and
> IReflectionOptimizer are used. I want to fully understand these interfaces
> and how they are used in order to make sure I'm implementing the
> MS.Extensions.DI "adapter" correctly and completely.
> Is there any documentation about those?
>
> On Saturday, September 19, 2020 at 7:32:42 AM UTC-4 haz...@gmail.com
> wrote:
>
>> Unfortunately no one has done this for
>> Micorosoft.Extensions.DependencyInjection. What you would need to do is to
>> implement IObjectsFactory (check examples from Fabio's blog). There are
>> only 3 or 4 methods.
>>
>> Best Regards,
>> Alexander
>>
>> On Fri, Sep 18, 2020 at 1:30 PM Eric Rizzo  wrote:
>>
>>> No, not at all. That just covers one pattern for registering the
>>> ISession and ISessionFactory so they can be injected into DI-managed
>>> services (something I already have). What I need is for NH to use the DI
>>> container when creating the pieces it uses under the covers, such as
>>> IConnectionProvider.
>>>
>>> Eric
>>>
>>>
>>> On Fri, Sep 18, 2020, 3:28 AM Paulo Quicoli  wrote:
>>>
 Hi

 Is this what you are looking for?

 https://gunnarpeipman.com/aspnet-core-nhibernate/

 On Fri, Sep 18, 2020, 07:52 eric@gmail.com 
 wrote:

> Trying to use dependency injection with custom NHibernate
> implementation classes, specifically an IConnectionProvider. To be
> clear, I have NO interest in using DI with *entities*, just in a
> custom impl of a NHibernate interface.
> I've read the (old) articles (here
> 
> and here
> )
> and they sound promising, but the implementations are for Autofac, Spring,
> and Castle Windsor. Has nobody ever published an impl for .Net Core's
> "default" Microsoft.Extensions.DependencyInjection? I can't believe it
> hasn't been done before.
>
> Any pointers?
>
> --
> You received this message because you are subscribed to the Google
> Groups "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to nhusers+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nhusers/e5065fc5-f8d7-4e9d-a9c4-5951404f59fcn%40googlegroups.com
> 
> .
>
 --
 You received this message because you are subscribed to a topic in the
 Google Groups "nhusers" group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/nhusers/cdRA62nFo7I/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 nhusers+u...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nhusers/CAF8vUGU56OEVaptvh6xm%3D%2BwDzTXRb4_q59XRCpN0K5Tt1U5Xkw%40mail.gmail.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "nhusers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to nhusers+u...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/nhusers/CAFW84TLNAJp_cFTidKDdnZV-y4SS9-xryXJ7jH8wpwqCPuJcNg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nhusers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nhusers/5cd07184-5464-4dde-8258-f2b0952ec00dn%40googlegroups.com
> 
> .
>

-- 
You received 

Re: [nhusers] NHibernate with Microsoft.Extensions.DependencyInjection

2020-09-21 Thread eric....@gmail.com
I looked at the implementations in Fabio's uNhAddIns project 
, and 
implementing IObjectsFactory is simple. But even looking at the NHibernate 
source code it's not clear how and when IBytecodeProvider and 
IReflectionOptimizer are used. I want to fully understand these interfaces 
and how they are used in order to make sure I'm implementing the 
MS.Extensions.DI "adapter" correctly and completely.
Is there any documentation about those?

On Saturday, September 19, 2020 at 7:32:42 AM UTC-4 haz...@gmail.com wrote:

> Unfortunately no one has done this for 
> Micorosoft.Extensions.DependencyInjection. What you would need to do is to 
> implement IObjectsFactory (check examples from Fabio's blog). There are 
> only 3 or 4 methods. 
>
> Best Regards,
> Alexander
>
> On Fri, Sep 18, 2020 at 1:30 PM Eric Rizzo  wrote:
>
>> No, not at all. That just covers one pattern for registering the ISession 
>> and ISessionFactory so they can be injected into DI-managed services 
>> (something I already have). What I need is for NH to use the DI container 
>> when creating the pieces it uses under the covers, such as 
>> IConnectionProvider.
>>
>> Eric
>>
>>
>> On Fri, Sep 18, 2020, 3:28 AM Paulo Quicoli  wrote:
>>
>>> Hi
>>>
>>> Is this what you are looking for?
>>>
>>> https://gunnarpeipman.com/aspnet-core-nhibernate/ 
>>>
>>> On Fri, Sep 18, 2020, 07:52 eric@gmail.com  
>>> wrote:
>>>
 Trying to use dependency injection with custom NHibernate 
 implementation classes, specifically an IConnectionProvider. To be 
 clear, I have NO interest in using DI with *entities*, just in a 
 custom impl of a NHibernate interface.
 I've read the (old) articles (here 
  
 and here 
 )
  
 and they sound promising, but the implementations are for Autofac, Spring, 
 and Castle Windsor. Has nobody ever published an impl for .Net Core's 
 "default" Microsoft.Extensions.DependencyInjection? I can't believe it 
 hasn't been done before.

 Any pointers?

 -- 
 You received this message because you are subscribed to the Google 
 Groups "nhusers" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to nhusers+u...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/nhusers/e5065fc5-f8d7-4e9d-a9c4-5951404f59fcn%40googlegroups.com
  
 
 .

>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "nhusers" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/nhusers/cdRA62nFo7I/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> nhusers+u...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/nhusers/CAF8vUGU56OEVaptvh6xm%3D%2BwDzTXRb4_q59XRCpN0K5Tt1U5Xkw%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "nhusers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to nhusers+u...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/nhusers/CAFW84TLNAJp_cFTidKDdnZV-y4SS9-xryXJ7jH8wpwqCPuJcNg%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nhusers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/5cd07184-5464-4dde-8258-f2b0952ec00dn%40googlegroups.com.


Re: [nhusers] NHibernate with Microsoft.Extensions.DependencyInjection

2020-09-19 Thread Alexander Zaytsev
Unfortunately no one has done this for
Micorosoft.Extensions.DependencyInjection. What you would need to do is to
implement IObjectsFactory (check examples from Fabio's blog). There are
only 3 or 4 methods.

Best Regards,
Alexander

On Fri, Sep 18, 2020 at 1:30 PM Eric Rizzo  wrote:

> No, not at all. That just covers one pattern for registering the ISession
> and ISessionFactory so they can be injected into DI-managed services
> (something I already have). What I need is for NH to use the DI container
> when creating the pieces it uses under the covers, such as
> IConnectionProvider.
>
> Eric
>
>
> On Fri, Sep 18, 2020, 3:28 AM Paulo Quicoli 
> wrote:
>
>> Hi
>>
>> Is this what you are looking for?
>>
>> https://gunnarpeipman.com/aspnet-core-nhibernate/
>>
>> On Fri, Sep 18, 2020, 07:52 eric@gmail.com 
>> wrote:
>>
>>> Trying to use dependency injection with custom NHibernate implementation
>>> classes, specifically an IConnectionProvider. To be clear, I have NO
>>> interest in using DI with *entities*, just in a custom impl of a
>>> NHibernate interface.
>>> I've read the (old) articles (here
>>> 
>>> and here
>>> )
>>> and they sound promising, but the implementations are for Autofac, Spring,
>>> and Castle Windsor. Has nobody ever published an impl for .Net Core's
>>> "default" Microsoft.Extensions.DependencyInjection? I can't believe it
>>> hasn't been done before.
>>>
>>> Any pointers?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "nhusers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to nhusers+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/nhusers/e5065fc5-f8d7-4e9d-a9c4-5951404f59fcn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "nhusers" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/nhusers/cdRA62nFo7I/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> nhusers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/nhusers/CAF8vUGU56OEVaptvh6xm%3D%2BwDzTXRb4_q59XRCpN0K5Tt1U5Xkw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nhusers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nhusers/CAFW84TLNAJp_cFTidKDdnZV-y4SS9-xryXJ7jH8wpwqCPuJcNg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nhusers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/CAMKuk24E7Nieeysr%3Do1%2BM4tH-LWExRBF%3D5Aj0k-sREcrq1Xt7A%40mail.gmail.com.


Re: [nhusers] NHibernate with Microsoft.Extensions.DependencyInjection

2020-09-18 Thread Eric Rizzo
No, not at all. That just covers one pattern for registering the ISession
and ISessionFactory so they can be injected into DI-managed services
(something I already have). What I need is for NH to use the DI container
when creating the pieces it uses under the covers, such as
IConnectionProvider.

Eric


On Fri, Sep 18, 2020, 3:28 AM Paulo Quicoli  wrote:

> Hi
>
> Is this what you are looking for?
>
> https://gunnarpeipman.com/aspnet-core-nhibernate/
>
> On Fri, Sep 18, 2020, 07:52 eric@gmail.com 
> wrote:
>
>> Trying to use dependency injection with custom NHibernate implementation
>> classes, specifically an IConnectionProvider. To be clear, I have NO
>> interest in using DI with *entities*, just in a custom impl of a
>> NHibernate interface.
>> I've read the (old) articles (here
>> 
>> and here
>> )
>> and they sound promising, but the implementations are for Autofac, Spring,
>> and Castle Windsor. Has nobody ever published an impl for .Net Core's
>> "default" Microsoft.Extensions.DependencyInjection? I can't believe it
>> hasn't been done before.
>>
>> Any pointers?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "nhusers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to nhusers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/nhusers/e5065fc5-f8d7-4e9d-a9c4-5951404f59fcn%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "nhusers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/nhusers/cdRA62nFo7I/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> nhusers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nhusers/CAF8vUGU56OEVaptvh6xm%3D%2BwDzTXRb4_q59XRCpN0K5Tt1U5Xkw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nhusers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/CAFW84TLNAJp_cFTidKDdnZV-y4SS9-xryXJ7jH8wpwqCPuJcNg%40mail.gmail.com.


Re: [nhusers] NHibernate with Microsoft.Extensions.DependencyInjection

2020-09-18 Thread Paulo Quicoli
Hi

Is this what you are looking for?

https://gunnarpeipman.com/aspnet-core-nhibernate/

On Fri, Sep 18, 2020, 07:52 eric@gmail.com  wrote:

> Trying to use dependency injection with custom NHibernate implementation
> classes, specifically an IConnectionProvider. To be clear, I have NO
> interest in using DI with *entities*, just in a custom impl of a
> NHibernate interface.
> I've read the (old) articles (here
> 
> and here
> )
> and they sound promising, but the implementations are for Autofac, Spring,
> and Castle Windsor. Has nobody ever published an impl for .Net Core's
> "default" Microsoft.Extensions.DependencyInjection? I can't believe it
> hasn't been done before.
>
> Any pointers?
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nhusers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nhusers/e5065fc5-f8d7-4e9d-a9c4-5951404f59fcn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nhusers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/CAF8vUGU56OEVaptvh6xm%3D%2BwDzTXRb4_q59XRCpN0K5Tt1U5Xkw%40mail.gmail.com.