public void AddNewFilm() { SelectedFilm = new FilmDisplayModel { ReleaseDate = DateTime.Today }; }
private void GetInputs(FilmDisplayModel film) { film.Title = FilmTitle; film.Description = FilmDescription; film.ImageLink = FilmImage; film.TrailerLink = FilmTrailer; film.ReleaseDate = FilmReleaseDate; film.Runtime = FilmRuntime; film.Language = FilmLanguage; }
private void SetInputs(FilmDisplayModel film) { FilmTitle = film.Title; FilmDescription = film.Description; FilmImage = film.ImageLink; FilmTrailer = film.TrailerLink; FilmReleaseDate = film.ReleaseDate; FilmRuntime = film.Runtime; FilmLanguage = film.Language; }
private async Task HandleDeleteFilm(FilmDisplayModel film) { try { await _events.PublishOnUIThreadAsync(new LoadingOnEvent()); await _filmEndpoint.DeleteFilm(film.Id); Films.Remove(film); SelectedFilm = null; } catch (Exception ex) { throw; } finally { await _events.PublishOnUIThreadAsync(new LoadingOffEvent()); } }
private async Task HandleEditFilm(FilmDisplayModel film) { try { await _events.PublishOnUIThreadAsync(new LoadingOnEvent()); GetInputs(film); await _filmEndpoint.EditFilm(FilmDisplayModelToModel(film)); SelectedFilm = null; } catch (Exception ex) { throw; } finally { await _events.PublishOnUIThreadAsync(new LoadingOffEvent()); } }
private async Task HandleAddFilm(FilmDisplayModel film) { try { await _events.PublishOnUIThreadAsync(new LoadingOnEvent()); GetInputs(film); film.Id = Guid.NewGuid().ToString(); await _filmEndpoint.AddFilm(FilmDisplayModelToModel(film)); Films.Add(film); SelectedFilm = null; } catch (Exception) { throw; } finally { await _events.PublishOnUIThreadAsync(new LoadingOffEvent()); } }
private FilmModel FilmDisplayModelToModel(FilmDisplayModel film) { return(_mapper.Map <FilmModel>(film)); }