public IEnumerable<Genre> ReadAll() { IEnumerable<Genre> tempList = new Facade().GetGenreRepository().FindAll(); if (tempList == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } else { return tempList; } }
public IEnumerable<Movie> ReadAll() { // IEnumerable<Movie> tempList = MovieConverter.ConvertToDTO(new Facade().GetMovieRepository().FindAll()); IEnumerable<Movie> tempList = new Facade().GetMovieRepository().FindAll(); if (tempList == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } else { return tempList; } }
public Genre Read(int id) { var tempGenre = new Facade().GetGenreRepository().Find(id); if (tempGenre == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } else { return tempGenre; } }
public Customer Read(int id) { var tempCustomer = new Facade().GetCustomerRepository().Find(id); if (tempCustomer == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } else { return tempCustomer; } }
public Movie Read(int id) { //var tempMovie = MovieConverter.convertMovie(new Facade().GetMovieRepository().Find(id)); var tempMovie = new Facade().GetMovieRepository().Find(id); if (tempMovie == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } else { return tempMovie; } }
public IEnumerable<Movie> ReadAllMovies() { var result = new Facade().GetMovieRepository().ReadAll(); return result; }
// DELETE api/values/5 public void Delete(int id) { var movie = new Facade().GetMovieRepository().Read(id); new Facade().GetMovieRepository().Delete(movie); }
// DELETE api/values/5 public void Delete(int id) { var customer = new Facade().GetCustomerRepository().Read(id); new Facade().GetCustomerRepository().Delete(customer); }
// DELETE api/values/5 public void Delete(int id) { var genre = new Facade().GetGenreRepository().Read(id); new Facade().GetGenreRepository().Delete(genre); }
// DELETE api/values/5 public void Delete(int id) { var order = new Facade().GetOrderRepository().Read(id); new Facade().GetOrderRepository().Delete(order); }