public MainResponse GetAllHorses(int exhibitorId)
        {
            var allHorses       = _horseRepository.GetAll(x => x.IsActive == true && x.IsDeleted == false);
            var exhibitorHorses = _exhibitorHorseRepository.GetAll(x => x.ExhibitorId == exhibitorId && x.IsActive == true && x.IsDeleted == false);

            if (allHorses.Count > 0)
            {
                var horses     = allHorses.Where(x => exhibitorHorses.All(y => y.HorseId != x.HorseId)).OrderBy(z => z.Name).ToList();
                var _allHorses = _mapper.Map <List <GetHorses> >(horses);
                GetExhibitorHorsesList getExhibitorHorsesList = new GetExhibitorHorsesList();
                getExhibitorHorsesList.getHorses     = _allHorses;
                _mainResponse.GetExhibitorHorsesList = getExhibitorHorsesList;
                _mainResponse.Success = true;
            }
            else
            {
                _mainResponse.Message = Constants.NO_RECORD_FOUND;
                _mainResponse.Success = false;
            }
            return(_mainResponse);
        }
Пример #2
0
 public IEnumerable <Models.Horse> GetAll(params System.Linq.Expressions.Expression <Func <Models.Horse, object> >[] includeProperties)
 {
     return(repository.GetAll());
 }