public IActionResult Create(DTO.Movie item) { var dalitem = new DAL.Movie(); dalitem.Director = item.Director; dalitem.Title = item.Title; dalitem.Length = item.Length; dalitem.Img = item.Img; DAL.MovieManager.AddMovie(dalitem); return(Created("http://localhost:6544/api/movie", item)); }
public ActionResult <DTO.Movie> GetById(int id) { DAL.Movie dalmovie = DAL.MovieManager.GetMovieById(id); DTO.Movie dtomovie = new DTO.Movie(); dtomovie.Director = dalmovie.Director; dtomovie.MovieId = dalmovie.MovieId; dtomovie.Length = dalmovie.Length; dtomovie.Title = dalmovie.Title; dtomovie.Img = dalmovie.Img; return(dtomovie); }
public ActionResult <DTO.Movie> Update(DTO.Movie item) { var newDalMovie = new DAL.Movie { Title = item.Title, MovieId = item.MovieId, Director = item.Director, Length = item.Length, Img = item.Img }; DAL.MovieManager.UpdateMovie(newDalMovie); return(NoContent()); }
public Movie() { objDAL = new DAL.Movie(); }