示例#1
0
        public async Task <IEnumerable <TeamModel> > GetTeamsAsync(string orderBy = "Id")
        {
            if (!_allowedOrderByValues.Contains(orderBy.ToLower()))
            {
                throw new InvalidOperationItemException($"The Orderby value: {orderBy} is invalid, please use one of {String.Join(',', _allowedOrderByValues.ToArray())}");
            }
            var entityList = await _foootballRepository.GetTeamsAsync(orderBy.ToLower());

            var modelList = _mapper.Map <IEnumerable <TeamModel> >(entityList);

            return(modelList);
        }