public IList <IViewActivityByHour> GetTop <IViewActivityByHourQueryParams>(int top, IViewActivityByHourQueryParams query)
        {
            _collection = new List <IViewActivityByHour>();
            string sqlCommand = "viewActivityByHourGetTop";

            using (DbCommand dbCmd = _dataBase.GetStoredProcCommand(sqlCommand))
            {
                _dataBase.AddInParameter(dbCmd, "@topParam", DbType.Int32, top);
                _dataBase.AddInParameter(dbCmd, "@fromParam", DbType.String, ((IDataQuery)query).From);
                _dataBase.AddInParameter(dbCmd, "@whereParam", DbType.String, ((IDataQuery)query).Where);
                _dataBase.AddInParameter(dbCmd, "@orderByParam", DbType.String, ((IDataQuery)query).OrderBy);

                using (IDataReader reader = _dataBase.ExecuteReader(dbCmd))
                {
                    while (reader.Read())
                    {
                        IViewActivityByHour viewActivityByHour = new ViewActivityByHour();

                        viewActivityByHour.Hour        = Convert.ToInt32(reader["hour"].ToString());
                        viewActivityByHour.TotalByHour = Convert.ToInt32(reader["totalByHour"].ToString());
                        _collection.Add(viewActivityByHour);
                    }
                }
            }

            return(_collection);
        }
        public IList <IViewActivityByHour> Find <IViewActivityByHourQueryParams>(IViewActivityByHourQueryParams query)
        {
            _collection = new List <IViewActivityByHour>();
            string sqlCommand = "viewActivityByHourFind";

            // Create a suitable command type and add the required parameter.
            using (DbCommand dbCmd = _dataBase.GetStoredProcCommand(sqlCommand))
            {
                _dataBase.AddInParameter(dbCmd, "@fromParam", DbType.String, ((IDataQuery)query).From);
                _dataBase.AddInParameter(dbCmd, "@whereParam", DbType.String, ((IDataQuery)query).Where);
                _dataBase.AddInParameter(dbCmd, "@orderByParam", DbType.String, ((IDataQuery)query).OrderBy);

                // Call the ExecuteReader method with the command.
                using (IDataReader reader = _dataBase.ExecuteReader(dbCmd))
                {
                    while (reader.Read())
                    {
                        IViewActivityByHour viewActivityByHour = new ViewActivityByHour();

                        viewActivityByHour.Hour        = Convert.ToInt32(reader["hour"].ToString());
                        viewActivityByHour.TotalByHour = Convert.ToInt32(reader["totalByHour"].ToString());
                        _collection.Add(viewActivityByHour);
                    }
                }
            }

            return(_collection);
        }
        public IViewActivityByHour GetById(int id)
        {
            IViewActivityByHour viewActivityByHour = new ViewActivityByHour();
            string sqlCommand = "viewActivityByHourFind";

            using (DbCommand dbCmd = _dataBase.GetStoredProcCommand(sqlCommand))
            {
                IDataQuery query = new DataQuery();

                _dataBase.AddInParameter(dbCmd, "@fromParam", DbType.String, query.From);
                _dataBase.AddInParameter(dbCmd, "@whereParam", DbType.String, query.Where);
                _dataBase.AddInParameter(dbCmd, "@orderByParam", DbType.String, query.OrderBy);

                // Call the ExecuteReader method with the command.
                using (IDataReader reader = _dataBase.ExecuteReader(dbCmd))
                {
                    while (reader.Read())
                    {
                        viewActivityByHour.Hour        = Convert.ToInt32(reader["hour"].ToString());
                        viewActivityByHour.TotalByHour = Convert.ToInt32(reader["totalByHour"].ToString());
                    }
                }
            }

            return(viewActivityByHour);
        }