Suggestion: Add RegisterProperty overloads to support child classes

Suggestion: Add RegisterProperty overloads to support child classes

Old forum URL: forums.lhotka.net/forums/t/8735.aspx


Regent posted on Monday, March 29, 2010

Currently BusinessBase<T>.RegisterProperty works only within first child of BusinessBase<T> class:

static PropertyInfo<P> RegisterProperty<P>(Expression<Func<T, object>> propertyLambdaExpression)

But I think it would be convenient to have additional overloads where T can be explicitly specified:

static PropertyInfo<P> RegisterProperty<P, T>(Expression<Func<T, object>> propertyLambdaExpression)

That way it will be possible to use RegisterProperty in all descendants as well.

RockfordLhotka replied on Monday, March 29, 2010

You can do this by using the overload where you pass the type as the first parameter to RegisterProperty().

 

Copyright (c) Marimer LLC