public async Task <IActionResult> RateMovie(string rate, string key) { if (movies.TryGetValue(key, out MovieViewModel res)) { movies[key].Grade = rate; res.Grade = rate; var movie = _queryfac.Build(new SingleMovieQuery(res.EpisodeId)).Get(); if (movie != null) { movie.Grade = rate; } else { movie = new Movie() { EpisodeId = res.EpisodeId, Grade = rate } }; _commFac.Build(new SaveMovieRateCommand(movie)).Execute(); return(View("GetDetails", res)); } return(null); }