public List <T> FindMany(IStatementSource source)
 {
     try
     {
         var sqlCommand = new SqlCommand(source.Query, DBConnection);
         sqlCommand.Parameters.AddRange(source.Parameters.ToArray());
         var reader = sqlCommand.ExecuteReader();
         var result = LoadAll(reader);
         reader.Close();
         return(result);
     }
     catch (SqlException e)
     {
         throw new ApplicationException(e.Message, e);
     }
 }
Beispiel #2
0
 public List <EntityBase> FindMany(IStatementSource source)
 {
     try
     {
         SessionFactory.GetCurrentSession().DbInfo.Connection.Open();
         var sqlCommand = new SqlCommand(source.Query, DBConnection);
         sqlCommand.Parameters.AddRange(source.Parameters.ToArray());
         var reader = sqlCommand.ExecuteReader();
         var result = LoadAll(reader);
         reader.Close();
         return(result);
     }
     catch (SqlException e)
     {
         throw new ApplicationException(e.Message, e);
     }
     finally
     {
         SessionFactory.GetCurrentSession().DbInfo.Connection.Close();
     }
 }
Beispiel #3
0
 public StockSource(IStockMapper mapper, IRawDataSource <StockRawData> stockRawDataSource, IStatementSource statementSource)
 {
     this.mapper             = mapper;
     this.statementSource    = statementSource;
     this.stockRawDataSource = stockRawDataSource;
 }