public IList <IViewUserAges> GetTop <IViewUserAgesQueryParams>(int top, IViewUserAgesQueryParams query)
        {
            _collection = new List <IViewUserAges>();
            string sqlCommand = "ViewUserAgesGetTop";

            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())
                    {
                        IViewUserAges ViewUserAges = new ViewUserAges();

                        ViewUserAges.Age = Convert.ToInt32(reader["age"].ToString());
                        _collection.Add(ViewUserAges);
                    }
                }
            }

            return(_collection);
        }
        public IViewUserAges GetById(int id)
        {
            IViewUserAges viewUserAges = new ViewUserAges();
            string        sqlCommand   = "ViewUserAgesFind";

            using (DbCommand dbCmd = _dataBase.GetStoredProcCommand(sqlCommand))
            {
                IDataQuery query = new DataQuery();
                query.Where = string.Format(" viewUserBattlResultId = {0} ", id);

                _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())
                    {
                        viewUserAges.Age = Convert.ToInt32(reader["age"].ToString());
                    }
                }
            }

            return(viewUserAges);
        }
        public IList <IViewUserAges> Find <IViewUserAgesQueryParams>(IViewUserAgesQueryParams query)
        {
            _collection = new List <IViewUserAges>();
            string sqlCommand = "ViewUserAgesFind";

            // Create a suitable command type and add the required parameter.
            using (DbCommand dbCmd = _dataBase.GetStoredProcCommand(sqlCommand))
            {
                // Call the ExecuteReader method with the command.
                using (IDataReader reader = _dataBase.ExecuteReader(dbCmd))
                {
                    while (reader.Read())
                    {
                        IViewUserAges ViewUserAges = new ViewUserAges();

                        ViewUserAges.Age = Convert.ToInt32(reader["age"].ToString());
                        _collection.Add(ViewUserAges);
                    }
                }
            }

            return(_collection);
        }