Esempio n. 1
0
 public static T SelectOne <T>(string sql, params object[] parameters) where T : new()
 {
     try
     {
         return(Executer.ExecuteReader <T>(sql, parameters).Single());
     }
     catch (InvalidOperationException)
     {
         throw new NotFoundException();
     }
 }
Esempio n. 2
0
 public static Grouped <T> SelectAllGroupedBy <T>(string sql, Func <T, int> groupId, params object[] parameters) where T : new()
 {
     return(new Grouped <T>(Executer.ExecuteReader <T>(sql, parameters), groupId));
 }
Esempio n. 3
0
 public static T[] SelectAll <T>(string sql, params object[] parameters) where T : new()
 {
     return(Executer.ExecuteReader <T>(sql, parameters).ToArray());
 }
Esempio n. 4
0
 public static T SelectFirst <T>(string sql, params object[] parameters) where T : new()
 {
     return(Executer.ExecuteReader <T>(sql, parameters).FirstOrDefault());
 }