public async Task <IActionResult> Index()
        {
            var locations = await _locationsRepository.GetAll().ToListAsync();

            ViewBag.Current = "Locations";
            return(View(locations));
        }
Ejemplo n.º 2
0
        public IEnumerable <LocationDto> GetAll()
        {
            var merchants = _repository
                            .GetAll()
                            .Select(AutoMapperHelper.Map <Location, LocationDto>)
                            .ToList();

            return(merchants);
        }
        public GroupsController(IGroupsRepository groupsRepository, ILocationsRepository locationsRepository)
        {
            _groupsRepository    = groupsRepository;
            _locationsRepository = locationsRepository;

            GroupVM = new GroupViewModel
            {
                Group     = new Group(),
                Groups    = new List <Group>(),
                Locations = _locationsRepository.GetAll().ToList()
            };
        }
 public IActionResult GetRandomCity() => Json((from record in _repository.GetAll() select record).OrderBy(x => Guid.NewGuid()).Take(1).FirstOrDefault());