public Movie Update(Movie movie) { using (var client = new HttpClient()) { //Put (update) movie object as json formatting to our web API localhost HttpResponseMessage response = client.PutAsJsonAsync("http://localhost:13993/api/movies/" + movie.ID, movie).Result; return response.Content.ReadAsAsync<Movie>().Result; } }
public ActionResult Update(Movie movie, List<int> genres) { movie.Genres = new List<Genre>(); foreach (var item in genres) { movie.Genres.Add(facade.GetGenreGateway().Read(item)); } facade.GetMovieGateway().Update(movie); return Redirect("Index"); }