Пример #1
0
        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);
        }
Пример #2
0
        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));
 }
Пример #4
0
 public void Notify <T>(Expression <Func <T> > property)
 {
     NotifyPrivate(ReflectionTools.BasePropertyInfo(property).Name);
     NotifyError();
 }
Пример #5
0
 public static string PropertyNiceName <T, R>(this HtmlHelper html, Expression <Func <T, R> > property)
 {
     return(ReflectionTools.BasePropertyInfo(property).NiceName());
 }