Пример #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));
        }
        public IActionResult Get()
        {
            IEnumerable <SavedLocation> savedLocations = _dataRepository.GetAll();

            return(Ok(savedLocations));
        }