thanks, I added IndexType = "int" and it now initialises, and I can
save data to the object, but but if I attempt a FinfAll() on this
object I get an exception that says:

{"The value \"0\" is not of type \"Project.PropertyType\" and cannot
be used in this generic collection.\r\nParameter name: key"}

All entires in the PropertyType enum are numbered 0 through to 3. I'm
not sure why its treating the value as a string, its correctly defined
int he database as an int.

I couldn't find any documentation on valid values for IndexType so I'm
not 100% sure I have set this correctly.

thanks

On Oct 23, 3:36 pm, Mauricio Scheffer <[email protected]>
wrote:
> Try setting the IndexType on [HasMany]
>
> On Oct 23, 12:25 pm, Mark <[email protected]> wrote:
>
>
>
> > Can anyone explain the difference between these two ?
>
> > This works:
> > [HasMany(Table = "MyDictionary", Element="Value", ElementType=typeof
> > (bool), ColumnKey = "ParentID", Index="Idx",
> > RelationType=RelationType.Map, Cascade =
> > ManyRelationCascadeEnum.None)]
> > public IDictionary<int, bool> Properties
> > {
> >  ...
>
> > }
>
> > but if I do this:
>
> > public enum PropertyType : int
> > {
> >  ...
>
> > }
>
> > [HasMany(Table = "MyDictionary", Element="Value", ElementType=typeof
> > (bool), ColumnKey = "ParentID", Index="Idx",
> > RelationType=RelationType.Map, Cascade =
> > ManyRelationCascadeEnum.None)]
> > public IDictionary<PropertyType, bool> Properties
> > {
> >  ...
>
> > }
>
> > I get the exception:
>
> > NHibernate.MappingException: Could not determine type for:
> > PropertyType, for columns: NHibernate.Mapping.Column(Idx)
>
> > this doesn't make any sense as if I do
>
> > [Property]
> > public PropertyType PropertyTypeTest
> > {
> >  ...
>
> > }
>
> > it is able to determine the type.
>
> > How do I manipulate ActiveRecord to create the correct mapping ?
>
> > Thanks- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to