public async Task<IActionResult> GetDegreesOfSeparation(string from, string to) { var results = await _graphPersonService.GetDegreesOfSeparationGraph(new Person {Name = from}, new Person {Name = to}); var model = new GraphViewModel(results); return Ok(model); }
public async Task<IActionResult> Get(string title, int year, string format) { switch (format) { case "g": { var results = await _graphMovieService.GetMovieGraphByTitleAndYearAsync(title, Convert.ToString(year)); var model = new GraphViewModel(results); return Ok(model); } case "n": { var results = await _movieService.GetMovieByTitleAndYearAsync(title, Convert.ToString(year)); return Ok(results); } } return HttpBadRequest("Invalid Format"); }
public async Task<IActionResult> GetByBirthYear(int year) { var results = await _graphPersonService.GetPersonGraphByBirthYearAsync(year); var model = new GraphViewModel(results); return Ok(model); }
public async Task<IActionResult> GetByBirthDate(DateTime birthDate) { var results = await _graphPersonService.GetPersonGraphByBirthDateAsync(birthDate); var model = new GraphViewModel(results); return Ok(model); }
public async Task<IActionResult> GetFilmography(string name) { var results = await _graphPersonService.GetPersonGraphByNameAsync(name); var model = new GraphViewModel(results); return Ok(model); }