Fabio, this is clear, but creating own factory is overhead(if I dont want use any IOC). In my ByteCodeProvider(exactly in ReflectionOptimizer.CreateCreateInstanceMethod) I want to use: return () => FormatterServices.GetUninitializedObject(type); instead of : ThrowExceptionForNoDefaultCtor(type); and that works fine with linfu and spring proxies(but their factories should have validator without checking default ctor). Or I have something wrong? Thank for reply.
On 23 ноя, 15:36, Fabio Maulo <[email protected]> wrote: > If you don't like the ProxyValidator you can: > 1) disable it <property name="use_proxy_validator">false</property> > 2) override the bytecode provider > <property > name="proxyfactory.factory_class">YourOwn.ByteCode.XYZ.ProxyFactoryFactory, > YourOwn.ByteCode.XYZ</property> > and provide your own validation. > > In order to use entities without default parameterless > ctor:http://fabiomaulo.blogspot.com/2008/11/entities-behavior-injection.html > > Part of that code now is available directly in Spring.NET+NH integration. > > 2009/11/22 Nik Govorov <[email protected]> > > > > > > > Hi. > > I think that ProxyFactoryFactory(from NHibernate.ByteCode.LinFu and > > NHibernate.ByteCode.Spring) should returns thier own implementations > > of IProxyValidator without checking default constructor: > > > using CommonDynProxyTypeValidator = > > NHibernate.Proxy.DynProxyTypeValidator; > > > namespace NHibernate.ByteCode.Castle > > { > > public class DynProxyTypeValidator : CommonDynProxyTypeValidator > > { > > protected override void CheckHasVisibleDefaultConstructor > > (System.Type type) > > { > > > } > > } > > } > > Now, for using entities without default ctor(apart from implementing > > BytecodeProvider), I have to disable proxy validation > > (use_proxy_validator), but there are some other important checks in > > DynProxyTypeValidator(also it's possible to create own > > ProxyFactoryFactory basen on LinFu or Spring factory, but I dont like > > this way). > > Thanks. > > > -- > > > You received this message because you are subscribed to the Google Groups > > "nhusers" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<nhusers%[email protected] > > > > > . > > For more options, visit this group at > >http://groups.google.com/group/nhusers?hl=. > > -- > Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=.
