コード例 #1
0
        public IEnumerable <AllowedEmailAddress> GetAllAllowedEmailAddresses(int maxCount = 0, int offset = 0)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            _queryBuilder.AddSelect(@"*");
            _queryBuilder.SetFrom("reg_student_email");

            if (maxCount > 0)
            {
                _queryBuilder.SetLimit("@limit");
                parameters.Add("@limit", maxCount);
            }
            if (offset > 0)
            {
                _queryBuilder.SetOffset("@offset");
                parameters.Add("@offset", offset);
            }

            string query = _queryBuilder.BuildQuery();

            var emailAddresses = _optionRepository.GetAllAllowedEmailAddresses(query, parameters);

            return(_mapper.Map <IEnumerable <AllowedEmailAddress> >(emailAddresses));
        }