public IActionResult CreateMovie(Movie.WebUI.Models.MovieModel model, IFormFile file) { if (ModelState.IsValid) { var entity = new Entity.Movie() { Name = model.Name, Description = model.Description, }; if (file != null) { entity.ImageUrl = file.FileName; var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot\\img", file.FileName); using (var stream = new FileStream(path, FileMode.Create)) { file.CopyTo(stream); } } _movieService.Create(entity); return(RedirectToAction("Index")); } else { return(View(model)); } }
public object Completo(Entity.Movie movie) { if (Equals(movie, null)) { return(null); } return(new { Id = movie.Id, Title = movie.Title, Genre = movie.Genre, ReleaseDate = movie.ReleaseDate, Cpf = movie.Cpf, Address = _addresDesv.Completo(movie.Address) }); }
public void Update(Entity.Movie entity, int[] categoryIds) { _movieDal.Update(entity, categoryIds); }
public void Update(Entity.Movie entity) { _movieDal.Update(entity); }
public void Delete(Entity.Movie entity) { _movieDal.Delete(entity); }
public void Create(Entity.Movie entity) { _movieDal.Create(entity); }
public void Update(Entity.Movie entity, int[] categoryIds) { throw new NotImplementedException(); }
public void Update(Entity.Movie entity) { throw new NotImplementedException(); }