[fluent-nhib] Re: Is there a way to tell AutoPersistence to not look at a property?

2009-03-19 Thread gre...@slavec.net
Just an observation, List ancestors; public virtual IList Ancestors { get { ancestors = ancestors ?? GetAncestors(this); return ancestors; } } This kind of properties will always be mapped with the current version of FNH, because of the im

[fluent-nhib] Re: Automapping and enums

2009-03-18 Thread gre...@slavec.net
Forgot to check if property is ReadOnly this code would be more appropriate: if (property.CanWrite) { if (property.PropertyType.IsEnum) return true; return property.PropertyType.Namespace == "System"; } On 18 mar., 14:42, "gre...@slavec.net" wro

[fluent-nhib] Re: Automapping and enums

2009-03-18 Thread gre...@slavec.net
line, like this: if (property.PropertyType.IsEnum) return true; Is this correct? On 18 mar., 14:02, "trull...@googlemail.com" wrote: > Looks like this answers my post a moment ago > > http://groups.google.com/group/fluent-nhibernate/browse_thread/thread... > > A

[fluent-nhib] Automapping and enums

2009-03-18 Thread gre...@slavec.net
Enums members in entities are skipped when automaping is used. I found this test in AutoMap tests: [Test] public void ShouldAutoMapEnums() { Model(model => model .ForTypesThatDeriveFrom(mapping => mapping.Map(x => x.Enum).SetAttrib

[fluent-nhib] Re: ignoreproperty

2009-03-17 Thread gre...@slavec.net
hack because it is a > hack. :)  What would make this easier to do is if we had a RemovePart > () method on the ClasslikeMapBase class, then I wouldn't have to cast > an IEnumerable to an IList. :) > > Patch for said change is > here:http://jonkruger.com/ClasslikeMapBase.Remove

[fluent-nhib] Re: ignoreproperty

2009-03-16 Thread gre...@slavec.net
You can try this: ... .WithConvention(convention => { convention.ForAttribute (UnmappableAttribute.RemoveMapping); }) ... public class UnmappableAttribute : Attribute { public static void RemoveMapping(UnmappableAttr

[fluent-nhib] Simple enumeration

2009-03-06 Thread gre...@slavec.net
Hi, Could support for standard Nhibernate enumeration mapping be added to AutoPersistenceModel? For example mapping a property Direction of type enum WindDirection {} would produce following output: Example implementation would be: public class Conventions { ... public void UseSimpl