public static T SetReadonly <T, V>(this T ident, Expression <Func <T, V> > readonlyProperty, V value) where T : ModifiableEntity { var pi = ReflectionTools.BasePropertyInfo(readonlyProperty); Action <T, V> setter = ReadonlySetterCache <T> .Setter <V>(pi); setter(ident, value); ident.SetSelfModified(); return(ident); }
public static T SetMixin <T, M, V>(this T entity, Expression <Func <M, V> > mixinProperty, V value) where T : IEntity where M : MixinEntity { M mixin = ((Entity)(IEntity)entity).Mixin <M>(); var pi = ReflectionTools.BasePropertyInfo(mixinProperty); var setter = MixinSetterCache <M> .Setter <V>(pi); setter(mixin, value); return(entity); }
public static bool PropertyEquals <S, T>(this PropertyInfo pi, Expression <Func <S, T> > property) { return(ReflectionTools.PropertyEquals(ReflectionTools.BasePropertyInfo(property), pi)); }
public void Notify <T>(Expression <Func <T> > property) { NotifyPrivate(ReflectionTools.BasePropertyInfo(property).Name); NotifyError(); }
public static string PropertyNiceName <T, R>(this HtmlHelper html, Expression <Func <T, R> > property) { return(ReflectionTools.BasePropertyInfo(property).NiceName()); }