In trying to map a simple ISet<string> within an Active Record class my app kept bombing while trying to perform the SchemaExport during app initialization. Here's the error I get resulting from some call in ActiveRecordStarter.cs:
The given key was not present in the dictionary.
I knew this was related to the following property in my User class:
[HasMany(typeof(System.String),"UserId","UserRoles",
Access = PropertyAccess.FieldCamelcase,
RelationType = RelationType.Set
)]
public virtual ISet<System.String> Roles
{ get { return roles; }}
Not until I went in to manually create my table did it dawn on me what I was missing:
Element = "Role"
DOH! I should have gone and looked at other mappings I have created by hand before chasing this down...so now it looks like:
[HasMany(typeof(System.String),"UserId","UserRoles",
Access = PropertyAccess.FieldCamelcase,
RelationType = RelationType.Set,
Element = "Role"
)]
public virtual ISet<System.String> Roles
{ get { return roles; }}
All is well again.
Posted
10-02-2007 2:11 PM
by
Michael Nichols