Пример #1
0
        public IActionResult Get(int id)
        {
            var Users          = _UserdataRepository.GetAll();
            var Locations      = _LocationdataRepository.GetAll();
            var SavedLocations = _dataRepository.GetAll();
            var query          = from User in Users
                                 join SavedLocation in SavedLocations on User.UserId equals SavedLocation.UserId
                                 join UserLocation in Locations on SavedLocation.SavedLocationId equals UserLocation.SavedLocationId
                                 where User.UserId == id
                                 select new
            {
                UserLocation.CityName
            };

            return(Ok(query));
        }
Пример #2
0
        public IActionResult Get()
        {
            IEnumerable <UserLocation> users = _dataRepository.GetAll();

            return(Ok(users));
        }