-
Couldn't load subscription status.
- Fork 8
Open
Labels
Description
Redmine Bug #1444
The following type of code should be driven back into habanero.
What is happening here is you are trying to get the SingleValue Def from the
ClassDef for Habanero.Testabiliy the identical code is used int Programmatic binding
and code with the same intent is used in Faces.
private static IRelationshipDef GetRelationshipDef<TReturn>(Expression<Func<T, TReturn>> propertyExpression, bool raiseErrIfNotExists)
{
string propertyName = GetPropertyName(propertyExpression);
return GetRelationshipDef(typeof(T), propertyName, raiseErrIfNotExists);
}
private static ISingleValueDef GetPropDef<TReturn>(Expression<Func<T, TReturn>> propertyExpression, bool raiseErrIfNotExists )
{
string propertyName = GetPropertyName(propertyExpression);
return GetPropDef(typeof(T), propertyName, raiseErrIfNotExists);
}
private static ISingleValueDef GetSingleValueDef<TReturn>(Expression<Func<T, TReturn>> propertyExpression)
{
var singleValueDef = GetPropDef(propertyExpression, false);
if (singleValueDef == null) singleValueDef = GetRelationshipDef(propertyExpression, true) as ISingleValueDef;
return singleValueDef;
}