Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SingleValue Support #44

Open
jeff2001 opened this issue Nov 14, 2013 · 0 comments
Open

SingleValue Support #44

jeff2001 opened this issue Nov 14, 2013 · 0 comments
Labels

Comments

@jeff2001
Copy link
Contributor

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;
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant