Convert .AsMap with KeyColumns to new Dictionary format
Hi,
I also need some help converting the .AsMap method to the new format.
Here is my old code:
HasMany(x => x.Claims)
.KeyColumns.Add("SchemeCode", "MainMemberNumber")
.AsMap(x => x.ChildNumber)
.Cascade.AllDeleteOrphan()
.Inverse();
2 Posted by igitur on 01 Nov, 2010 05:22 AM
Please?
Support Staff 3 Posted by James Gregory on 05 Nov, 2010 01:38 PM
What are you stuck on in particular?
The
AsMap
is unnecessary, as theHasMany(IDictionary)
method you're using assumes it's a map.KeyColumns
has become aForeignKey
closure (see below), and the rest is the same.Becomes
4 Posted by igitur on 05 Nov, 2010 01:46 PM
Thanks. It was the .KeyColumns part that boggled me.
Is there perhaps an Old FNH -> New FNH conversion FAQ somewhere?
Support Staff 5 Posted by James Gregory on 05 Nov, 2010 01:57 PM
Not yet, but there will be for the 2.0 release.
You should be aware that the
master
branch (and consequently the CI builds that are available on the site) are considered unstable; it's the branch that will eventually become 2.0, but that's quite a way-away yet, and will include many breaking changes.If you're wanting to keep on top of the bugfixes but don't want all the breaking changes, you should follow the v1.x branch instead. Binaries aren't currently available on the website (though you can get them from our CI system), but they will be before long.
I'm looking to update the website very soon to make all this clear, as it's becoming obvious people might not be entirely aware what they're getting into when they're taking the CI builds from the website.
6 Posted by igitur on 07 Mar, 2011 10:12 AM
Thanks.
How do I specify which class property defines the dictionary key?
The
x => x.ChildNumber
part. I saw there is a new.DictionaryKey()
method, but it accepts only a column string, not a member expression.