Even if we are already validating many situations, about proxy, we have to
add some more validations.
To avoid hearing people say that NH has too many restrictions we may log
some ERROR.

Rule:
An entity with lazy-property have to have properties getters and setters
for all properties and accessors to properties (no access=field no
access=nosetter).

Example of implementation:
public virtual IEnumerable<Gallery> Galleries
{
get { return galleries; }
protected set { galleries = (Iesi.Collections.Generic.ISet<Gallery>) value;
}
}

Today:
we have a not needed log-ERROR about "Lazy or no-proxy property is not an
auto property" (the restriction was removed) but all others properties need
an on-the-fly-overrideable setter to work correctly.

Without an overrideable setter and/or an setter accessor to field, the
proxy for leazy-properties can't work correctly.

The main reason is that the real solution is a lazy access to the fields
(as in Hibernate) but we can't do it without IL-rewriters.
-- 
Fabio Maulo

Reply via email to