コード例 #1
0
        public GenderSeperatedViewModel GetAnimals()
        {
            GenderSeperatedViewModel animalViewModel = new GenderSeperatedViewModel();

            try
            {
                _ownerService = new OwnerService();
                _business     = new Business();

                var list = _ownerService.GetAllOwnerList();                                 // Call service that pulls out all owner data along with their animals and prepare a owner list
                List <OwnerModel> ownerViewModel = GetAllOwnerAnimalsViewModel(list);       //Convert result into owner model
                animalViewModel = _business.GetGenderSeparatedOwnerCatList(ownerViewModel); //Get result view model consisting both models 1. Male, 2. Female
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(animalViewModel);
        }