public IActionResult UpdateRequest(int id, [FromBody] TutoringRequest request)
        {
            if (id != request.Id)
            {
                return(BadRequest());
            }
            _context.TutoringRequests.Update(request);
            _context.SaveChanges();

            return(Ok(request));
        }
        public IActionResult CreateRequest([FromBody] TutoringRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Add(request);
            _context.SaveChanges();

            return(Ok(request));
        }
        /// <summary>
        ///     Gets Tutorings in ragne of 100000km, maximum 50
        /// </summary>
        /// <returns>List of Tutorings</returns>
        public async Task <List <Tutoring> > GetTutorings()
        {
            Debug.WriteLine("Getting Offers");
            var serv            = LocationService.GetInstance();
            var tutoringRequest = new TutoringRequest
            {
                latitude       = (int)(await serv.GetPosition()).Latitude,
                longitude      = (int)(await serv.GetPosition()).Longitude,
                authentication = MvvmNanoIoC.Resolve <Authentication>(),
                rangeKm        = 100000,
                rowLimit       = 50,
                rowOffset      = 0
            };

            Debug.WriteLine(MvvmNanoIoC.Resolve <Authentication>().userName);
            _restUrl = "http://tutorscout24.vogel.codes:3000/tutorscout24/api/v1/tutoring/";

            //Add corresponding string
            if (MasterDetailViewModel.CurrentMode.Equals(MasterDetailViewModel.Mode.STUDENT))
            {
                _restUrl += "offers";
            }
            else
            {
                _restUrl += "requests";
            }

            var uri  = new Uri(string.Format(_restUrl, string.Empty));
            var json = JsonConvert.SerializeObject(tutoringRequest);

            Debug.WriteLine("JSON Serialized:" + json);
            var content  = new StringContent(json, Encoding.UTF8, "application/json");
            var response = await _client.PostAsync(uri, content);

            if (response.IsSuccessStatusCode)
            {
                Debug.WriteLine("Got Offers");
                var rescontent = await response.Content.ReadAsStringAsync();

                return(JsonConvert.DeserializeObject <List <Tutoring> >(rescontent));
            }
            Debug.WriteLine(await response.Content.ReadAsStringAsync());
            return(null);
        }