Hello,

lets start with some code, here is my setup:

mappingConfiguration.AutoMappings.Add(AutoMap
                                        .AssemblyOf<User>()
 
        .UseOverridesFromAssemblyOf<User>()
 
        .Conventions.AddFromAssemblyOf<User>()
                                        .Where(t => typeof
(IEntity).IsAssignableFrom(t) &&
                                                    t.IsClass)

here is my Id Convention

public class IdConvention : IIdConvention, IIdConventionAcceptance
{
        public void Accept(IAcceptanceCriteria<IIdentityInspector> criteria)
        {
                criteria.Expect(c => c.Property.PropertyType == typeof(Guid) &&
c.Property.Name.ToUpper() == "ID");
        }

        public void Apply(IIdentityInstance instance)
        {
                instance.GeneratedBy.GuidComb();
        }
}

with or without the conventions in place, my Id mappings end up like
this:

<id name="Id" type="System.Guid, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <column name="Id" />
        <generator class="identity" />
</id>

With the convention in place, the Apply() method is run on my
entities, but the xml remains the same :(

to further debug, i tried this:

public void Apply(IIdentityInstance instance)
{
        instance.GeneratedBy.GuidComb();
        instance.Column("wibble");
}

which ends up as:

<id name="Id" type="System.Guid, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <column name="wibble" />
        <generator class="identity" />
</id>

Bug? or am i being daft (highly probable)

Andrew

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" 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/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to