public IEnumerable <SelectListItem> GetCountries() { return(repository .GetAll <Country>() .Select(c => new SelectListItem { Value = c.Id.ToString(), Text = c.Name }).OrderBy(x => x.Text)); }
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(); }
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); }
/// <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); }
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); }
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()); }