public void UpdateTrailer(TrailerViewModel trailer) { var trailerToRemove = _trailerRepository.GetById(trailer.TrailerC); var updateTrailer = Mapper.Map <TrailerViewModel, Trailer_M>(trailer); _trailerRepository.Delete(trailerToRemove); _trailerRepository.Add(updateTrailer); SaveTrailer(); }
public Trailer GetTrailerById(string Id) { Guid idToSearch = Guid.Parse(Id); var trailer = trailersRepository.GetById(idToSearch); //var trailer = trailersRepository.GetTrailerById(idToSearch); if (trailer == null) { throw new Exception(); } return(trailer); }