Skip to content

SingleValue Support #44

@jeff2001

Description

@jeff2001

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;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions