public static T ListFirst <T>(this StoredProcedure parameter, IConnectinContext cc) where T : new() { IList <T> items = cc.ListProc <T>(parameter); if (items != null && items.Count > 0) { return(items[0]); } return(default(T)); }
public static object ExecProcToObject(Type type, IConnectinContext cc, object parameter) { IList items = cc.ListProc(type, parameter); if (items != null && items.Count > 0) { return(items[0]); } return(null); }
public object Execute(IConnectinContext cc, object value, HandlerValueType type) { string[] orderby = DBContext.CurrentOrderBy; Region curegion = DBContext.CurrentRegion; DBContext.CurrentRegion = null; DBContext.CurrentOrderBy = null; switch (type) { case HandlerValueType.String: string str = (string)value; if (GetValue.IsSelectSQL(str)) { return(new SQL(str).List(Type, cc, curegion)); } else { Expression exp = new Expression(str); return(exp.List(Type, cc, curegion, orderby)); } case HandlerValueType.SQL: return(((SQL)value).List(Type, cc, curegion)); break; case HandlerValueType.PROC: return(cc.ListProc(Type, value)); case HandlerValueType.EXPRESSION: return(((Expression)value).List(Type, cc, curegion, orderby)); default: throw new PeanutException("object is not a [SQL,StoredProcedure,Expression]!"); } }
public static IList <T> List <T>(this StoredProcedure parameter, IConnectinContext cc) where T : new() { return(cc.ListProc <T>(parameter)); }
public static IList <T> ExecProcToObjects <T>(IConnectinContext cc, object parameter) where T : new() { return(cc.ListProc <T>(parameter)); }