Example #1
0
        public void Can_get_attribute_empty_value_from_null_accessor()
        {
            IEntityGetter <xts_entity> accessor = null;

            Assert.Null(accessor.Get(e => e.xts_attribute));
            Assert.Null(accessor.Get(e => e.xts_withcolumnattribute));
            Assert.Null(accessor.Get(e => e.xts_money));
            Assert.Null(accessor.Get(e => e.xts_optionsetvalue));
        }
Example #2
0
 public static TV GetAliasedValue <TV>(this IEntityGetter <Entity> accessor, string attributeName)
 => (TV)accessor.Get <AliasedValue>(attributeName)?.Value;
Example #3
0
 public static bool Equal <T, TV>(this IEntityGetter <T> accessor, string attribute, TV comparisonValue)
     where T : Entity => Equal(accessor.Get <TV>(attribute), comparisonValue);
Example #4
0
 public static TV Get <T, TV>(this IEntityGetter <T> accessor, Expression <Func <T, TV> > attribute)
     where T : Entity => accessor != null?accessor.Get <TV>(Name(attribute)) : default(TV);