Ok, not a problem. You guys rock!

On 11 Бер, 14:46, James Gregory <jagregory....@gmail.com> wrote:
> Thanks, but I wouldn't waste your time. That sounds harsh, but there's going
> to be a big conventions rewrite dropping very soon, I've got all the code
> ready to commit and I'm just writing up the wiki changes now. So any changes
> you make will be redundant very soon.
>
>
>
> On Wed, Mar 11, 2009 at 12:42 PM, Mike Chaliy <m...@chaliy.name> wrote:
>
> > Something like this:
>
> > convention.OverrideType(t => t == typeof(Uri), typeof
> > (NHibernateUriUserType));
>
> > This will elimenate additional ITypeConvention class.
>
> > Also, if someone interested I can prepare patch.
>
> > Follwing is psewdo code.
>
> > public static class OverrideConventionExtensions
> > {
> >        public static void OverrideType(this Conventions conventions,
> > Func<Type, bool> predicate, Type customType)
> >        {
> >                conventions.AddTypeConvention(new
> > OverrideConvention(predicate,
> > customType));
> >        }
> > }
>
> > public class OverrideConvention : ITypeConvention
> > {
> >        private readonly Func<Type, bool> _predicate;
> >        private readonly Type _customType;
>
> >        public OverrideConvention(Func<Type, bool> predicate, Type
> > customType)
> >        {
> >                _predicate = predicate;
> >                _customType = customType;
> >        }
>
> >        public bool CanHandle(Type type)
> >        {
> >                return _predicate(type);
> >        }
>
> >        public void AlterMap(IProperty propertyMapping)
> >        {
> >                if (!propertyMapping.HasAttribute("type"))
> >                {
> >                        propertyMapping.CustomTypeIs(_customType);
> >                 }
>
> >        }
> > }
>
> > On 11 Бер, 12:07, James Gregory <jagregory....@gmail.com> wrote:
> > > That's the correct way. How much easier do you want?
>
> > > On Tue, Mar 10, 2009 at 3:25 PM, Mike Chaliy <m...@chaliy.name> wrote:
>
> > > > Hi all,
>
> > > > I have custom IUserType - UriUserType, how to configure AutoMapping to
> > > > use this type for all Uri properties?
>
> > > > At this time I am using custom implementation of the ITypeConvention
> > > > and register it with convention.AddTypeConvention(). This is okay? Is
> > > > there something more easy?- Сховати цитований текст -
>
> > > - Показати цитований текст -- Сховати цитований текст -
>
> - Показати цитований текст -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to