I'm using Sharp Architecture and that is how the Northwind sample they
have implemented it.

Previously it was this:
        /// <summary>
        /// Provides a filter for only including types which inherit
from the IEntityWithTypedId interface.
        /// </summary>

        private bool GetAutoMappingFilter(Type t)
        {
            return t.GetInterfaces().Any(x =>
                                         x.IsGenericType &&
                                         x.GetGenericTypeDefinition()
== typeof(IEntityWithTypedId<>));
        }

public AutoPersistenceModel Generate()
        {
            var mappings = new AutoPersistenceModel();
 
mappings.AddEntityAssembly(typeof(Class1).Assembly).Where(GetAutoMappingFilter);
            mappings.Conventions.Setup(GetConventions());
            mappings.Setup(GetSetup());
            mappings.IgnoreBase<Entity>();
            mappings.IncludeBase(typeof(Asset));
            mappings.IgnoreBase(typeof(EntityWithTypedId<>));
 
mappings.UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();

            return mappings;

        }

 private Action<AutoMappingExpressions> GetSetup()
        {
            return c =>
            {
                c.FindIdentity = type => type.Name == "Id";
            };
        }
I reverted back to the original code, which is using deprecated
interfaces, for now.

On Apr 3, 1:33 am, James Gregory <jagregory....@gmail.com> wrote:
> public override bool ShouldMap(System.Type type)
>         {
>             return type.GetInterfaces().Any(x =>
>                  x.IsGenericType && x.GetGenericTypeDefinition() ==
> typeof(IEntityWithTypedId<>));
>         }
>
> This doesn't look right to me, what are you trying to do?

-- 
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