public IEnumerable <SelectListItem> GetCountries()
 {
     return(repository
            .GetAll <Country>()
            .Select(c => new SelectListItem {
         Value = c.Id.ToString(),
         Text = c.Name
     }).OrderBy(x => x.Text));
 }
Exemplo n.º 2
0
        public PublicRegisterViewModelBuilder(
            IMapper mapper,
            IEntityFrameworkRepository repository,
            ILicenceRepository licenceRepository,
            IReferenceDataProvider referenceDataProvider)
        {
            _mapper                = mapper;
            _licenceRepository     = licenceRepository;
            _referenceDataProvider = referenceDataProvider;

            _ukCountries = repository.GetAll <Country>().Select(x =>
                                                                new SelectListItem {
                Value = x.Name, Text = x.Name
            }).OrderBy(y => y.Text).ToList();
        }
Exemplo n.º 3
0
        public IEnumerable <Recipe> GetAll()
        {
            var allRecipes = recipeRepository.GetAll();

            foreach (var recipe in allRecipes)
            {
                var ingredients = ingredientService.GetIngredientsForRecipe(recipe.Id).ToList();
                if (ingredients == null || ingredients[0] == null)
                {
                    ingredients = new List <Ingredient>();
                }
                recipe.Ingredients = ingredients;
            }

            return(allRecipes);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the people.
        /// </summary>
        /// <param name="searchJobId">The search job identifier.</param>
        /// <returns></returns>
        public IEnumerable <Models.Domain.Person> GetPeople()
        {
            var peopleEntities = Repository.GetAll <Models.Entities.Person>(includeProperties: "Addresses, Phones, Associates");

            var people = new List <Models.Domain.Person>();

            foreach (var personEntity in peopleEntities)
            {
                var peopleConversion = PeopleFactory.Get(personEntity);
                people.AddRange(peopleConversion);
            }

            var distinctPeople = people.Distinct().ToList();

            return(distinctPeople);
        }
Exemplo n.º 5
0
        public AdminStatusDashboardViewModel Build()
        {
            var statuses = _repository.GetAll <LicenceStatus>();
            var adminStatusRecordsLicenceViewModel = new AdminStatusDashboardViewModel();
            var licenceStatuses = statuses.GroupJoin(_licenceRepository.GetAllEntriesWithStatusesAndAddress(), ls => ls.Id,
                                                     l => l.CurrentStatusChange.Status.Id, (ls, licences) => new { ls, licences });

            foreach (var licenceStatus in licenceStatuses)
            {
                adminStatusRecordsLicenceViewModel.AdminStatusCountViewModels.Add(
                    new AdminStatusCountViewModel
                {
                    LicenceStatusViewModel  = _mapper.Map <LicenceStatusViewModel>(licenceStatus.ls),
                    LicenceApplicationCount = licenceStatus.licences?.Count() ?? 0
                }
                    );
            }

            return(adminStatusRecordsLicenceViewModel);
        }
Exemplo n.º 6
0
        public async Task <List <User> > GetUserAll()
        {
            var usr = await _userRepository.GetAll().ToListAsync();

            return(usr);
        }
 public IEnumerable <RecipeFamily> GetAll()
 {
     return(recipeFamilyRepository.GetAll());
 }
 public IEnumerable <Ingredient> GetAll()
 {
     return(ingredientRepository.GetAll());
 }