Richard,
The proposition is only for the high-level API.
The underlining API is this:
void Property(MemberInfo property, Action<IPropertyMapper> mapping);


On Thu, Apr 28, 2011 at 11:24 AM, Richard Brown (gmail) <
[email protected]> wrote:

>   +1 for strings ... it also enables using reflection based usage on the
> API.
>
>   *From:* Fabio Maulo <[email protected]>
> *Sent:* Thursday, April 28, 2011 12:20 PM
> *To:* [email protected]
> *Subject:* [nhibernate-development] Mapping by-code protected/private
> members
>  To explicit map private field I done this
> ca.Property(ForClass<MyClass>.Field("something"), map => map.Length(150));
>
> To explicit map private/protected properties I should do something like
> this
> ca.Property(ForClass<MyClass>.Property("Something"), map =>
> map.Length(150));
>
> The matter is that at the end, if we don't want an "invasion" to the users
> domain-model (and I would always avoid it), we end with a string
> representing the private/protected member-name.
> Using the ConventionModelMapper there is "no problem" if the user can
> accept to write the mapping catching that member in the BeforeMapProperty
> event (or similar for others relations).
>
> I would introduce a short-cut
> ca.Property("Something", map => map.Length(150));
>
> Thoughts ?
>
> --
> Fabio Maulo
>
>


-- 
Fabio Maulo

Reply via email to