public static T ResultScalar <T>(this IAncestorResult result, T defaultValue = default(T))
 {
     try
     {
         return((T)AncestorResultHelper.ResultScalar(result));
     }
     catch
     {
         return(defaultValue);
     }
 }
        public static Tuple <T1, T2> ResultFirst <T1, T2>(this IAncestorResult result, Func <Tuple <T1, T2> > objectFactory = null, ResultListMode?mode = null, Encoding hardwordEncoding = null)
        {
            var m = mode ?? (objectFactory != null ? ResultListMode.Value : ResultListMode.All);

            return((Tuple <T1, T2>)AncestorResultHelper.ResultFirst(result, new Type[] { typeof(T1), typeof(T2) }, objectFactory, m, hardwordEncoding));
        }
        public static T ResultFirst <T>(this IAncestorResult result, Func <T> objectFactory, ResultListMode?mode = null, Encoding hardwordEncoding = null)
        {
            var m = mode ?? (objectFactory != null ? ResultListMode.Value : ResultListMode.All);

            return((T)AncestorResultHelper.ResultFirst(result, typeof(T), objectFactory, m, hardwordEncoding));
        }
예제 #4
0
 public virtual List <T> ResultScalarList <T>()
 {
     return(AncestorResultHelper.ResultScalarList <T>(this));
 }
예제 #5
0
 public virtual object ResultScalar()
 {
     return(AncestorResultHelper.ResultScalar(this));
 }
예제 #6
0
 public T ResultFirst <T>(Encoding encoding = null) where T : class, new()
 {
     return((T)AncestorResultHelper.ResultFirst(this, typeof(T), null, ResultListMode.All, encoding));
 }