Changing the line
HasMany(x =>
x.GetAssets()).Access.
CamelCaseField(Prefix.Underscore).ReadOnly().AsBag();
HasMany(x => x.GetAssets()).ReadOnly().AsBag();
Gives me this error:
System.ArgumentException : Not a member access
Parameter name: expression
@James Gregory Exporting the xml created from HasMany(x =>
x.GetAssets()).Access.
CamelCaseField(Prefix.Underscore).ReadOnly().AsBag();
is
<bag access="field.camelcase-underscore" inverse="true" name="
_assets" mutable="false">
<key>
<column name="Gift_id" />
</key>
<one-to-many class="BlogSamples.Core.Domain.Asset, BlogSamples.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bag>
I think NHibernate itself adds prepends the extra underscore on so:
_assets becomes __assets
whereas I think the correct hbm output would be
<bag access="field.camelcase-underscore" inverse="true" name="
assets" mutable="false">
which NHibernate would interpret as _assets
I maybe though