private Models.Movies.MovieInputModel ToInputModel(OtherLayers.Movie model) { return(new Models.Movies.MovieInputModel { Id = model.Id, Title = model.Title, ReleaseYear = model.ReleaseYear, Summary = model.Summary }); }
private Models.Movies.MovieOutputModel ToOutputMovie(OtherLayers.Movie movie) { return(new Models.Movies.MovieOutputModel { Id = movie.Id, Title = movie.Title, ReleaseYear = movie.ReleaseYear, Summary = movie.Summary, LastReadAt = DateTime.Now }); }
public IActionResult OnPost() { if (!ModelState.IsValid) { return(Page()); } var model = new OtherLayers.Movie { Id = Movie.Id, Title = Movie.Title, ReleaseYear = Movie.ReleaseYear, Summary = Movie.Summary }; this.service.UpdateMovie(model); return(RedirectToPage("./Index")); }