Created
April 3, 2020 01:20
-
-
Save rafaeldalsenter/eba1e10d570a7c41a893087c8020dd47 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public async Task<DirectorsByCountryDto> GetDirectorsByCountry(string countryName) | |
| { | |
| ... | |
| try | |
| { | |
| var cqlQuery = @"select director as Name from netflix_titles where country=? allow filtering"; | |
| var returnQuery = await _cassandraContext.SelectAsync<string>(cqlQuery, countryName); | |
| var directors = returnQuery.ToList(); | |
| return new DirectorsByCountryDto | |
| { | |
| Country = countryName, | |
| Directors = directors, | |
| ErrorMessage = !directors.Any() ? $"Não foi encontrado nenhum diretor para o país {countryName}" : null | |
| }; | |
| } | |
| catch (Exception ex) | |
| { | |
| ... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment