omdb init
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -396,3 +396,6 @@ FodyWeavers.xsd
|
|||||||
# JetBrains Rider
|
# JetBrains Rider
|
||||||
*.sln.iml
|
*.sln.iml
|
||||||
|
|
||||||
|
# =======
|
||||||
|
# MINE
|
||||||
|
APIKey.txt
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -1,3 +1,12 @@
|
|||||||
# test-alebro
|
# test-alebro
|
||||||
|
|
||||||
Test per colloquio
|
Test per colloquio
|
||||||
|
|
||||||
|
## Istruzioni per l'esecuzione
|
||||||
|
|
||||||
|
Dopo aver clonato il repository, crea un file APIKey.txt nella cartella radice del progetto e inserisci l'API Key di OMDb.
|
||||||
|
|
||||||
|
Poi esegui il progetto con:
|
||||||
|
```bash
|
||||||
|
dotnet run
|
||||||
|
```
|
||||||
|
|||||||
24
Services/OmdbService.cs
Normal file
24
Services/OmdbService.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
|
||||||
|
class OmdbService
|
||||||
|
{
|
||||||
|
private readonly string url;
|
||||||
|
|
||||||
|
public OmdbService()
|
||||||
|
{
|
||||||
|
var apiKey = File.ReadAllText("APIKey.txt").Trim();
|
||||||
|
apiKey = System.Net.WebUtility.UrlEncode(apiKey);
|
||||||
|
|
||||||
|
url = "http://www.omdbapi.com/?apikey=" + apiKey + "&";
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void FetchMovieDetail(string id)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void FetchMovies(string searchTitle)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user