--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To post to this group, send email to fluent-n...@googlegroups.com.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
GeneratedBy.Sequence("somesequencename")
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dllAdditional information: An item with the same key has already been added.
namespace FluentNHibernate.Conventions.Instances
{public class IdentityInstance : IdentityInspector, IIdentityInstance...
public IGeneratorInstance GeneratedBy
{get{mapping.Set(x => x.Generator,Layer.Conventions, new GeneratorMapping());return new GeneratorInstance(mapping.Generator, mapping.Type.GetUnderlyingSystemType());}}
return new GeneratorInstance(mapping.Generator, mapping.Type.GetUnderlyingSystemType());
public GeneratorMapping Generator
{
get { return attributes.GetOrDefault<GeneratorMapping>("Generator"); }
}
public static class AttributeStoreExtensions
{
public static T GetOrDefault<T>(this AttributeStore store, string attribute)
{
return (T)(store.Get(attribute) ?? default(T));
}
}
[Serializable]
public class AttributeStore
{
...
public object Get(string property)
{
var values = layeredValues[property];
if (!values.Any())
return null;
var topLayer = values.Max(x => x.Key);
return values[topLayer];
}
Your overrides should take effect if you are EXPLICIT about them. If you give an override that says Map(x => x.Stuff).ReadOnly(); it's still going to use your ColumnNameConvention. But if you say
Map(x => x.Stuff).Column("AwesomeStuff").ReadOnly(); then you have overriden your convention.
On Mon, Jun 11, 2012 at 12:11 PM, ag <alexg...@gmail.com> wrote:
Is there some good documentation about the relation between overridesand conventions ? Especially in the sequence that they are called.I looked around and I found documentation about each one seperatelynot about how they interact.On debugging I discovered to my surprise that my overrides are calledfirst and then the conventions are called.There is probably a reason for this, so if someone can explain this orpoint to some documentation link, I would appreciate it. I'm probablymissing some important concept.The reason I would expect it to be first conventions and thenoverrides, Is that I thought conventions are extenstions/overrides tothe default automapping and for the cases in which the conventionwould yield incorrect results, you could still use an override.Kind regards,Alex
--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+unsubscribe@googlegroups.com.