Example #1
0
 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);
     }
 }
Example #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();
     }
 }
Example #3
0
 public StockSource(IStockMapper mapper, IRawDataSource <StockRawData> stockRawDataSource, IStatementSource statementSource)
 {
     this.mapper             = mapper;
     this.statementSource    = statementSource;
     this.stockRawDataSource = stockRawDataSource;
 }