-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
114 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
3 changes: 3 additions & 0 deletions
3
Web Services And Cloud/MovieInfoApp/MovieInfoApp/.bin/git.cmd
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
SET PATH=%~dp0;%PATH% | ||
"%~dp0node" "%~dp0..\..\packages\NoGit.0.0.8\node_modules\nogit\bin\git.js" %* |
3 changes: 3 additions & 0 deletions
3
Web Services And Cloud/MovieInfoApp/MovieInfoApp/.bin/node.cmd
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
SET PATH=%PATH%;%~dp0 | ||
"%~dp0..\..\packages\Node.js.0.10.28\node.exe" %* |
45 changes: 45 additions & 0 deletions
45
Web Services And Cloud/MovieInfoApp/MovieInfoApp/ActorInfo.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
namespace MovieInfoApp | ||
{ | ||
using System; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
|
||
using Models; | ||
using Newtonsoft.Json; | ||
|
||
public class ActorInfo | ||
{ | ||
private static ActorInfo retrieve; | ||
|
||
private ActorInfo(HttpClient client, string endpoint) | ||
{ | ||
this.PrepareEndpoint(client, endpoint); | ||
} | ||
|
||
public static async Task<ActorModel> GetActorInfoByName(HttpClient client,string actorName) | ||
{ | ||
string responseData; | ||
string escapedName = Uri.EscapeUriString(actorName); | ||
|
||
client.BaseAddress = client.BaseAddress.AddParameter("query", escapedName); | ||
|
||
Task<string> response = client.GetStringAsync(""); | ||
responseData = await response; | ||
|
||
var actors = JsonConvert.DeserializeObject<ActorSearchResultsModel>(responseData); | ||
|
||
return actors.Results.FirstOrDefault(); | ||
} | ||
|
||
private Uri PrepareEndpoint(HttpClient client, string endpoint) | ||
{ | ||
UriBuilder targetUrl = new UriBuilder(client.BaseAddress); | ||
targetUrl.Path = endpoint; | ||
|
||
client.BaseAddress = targetUrl.Uri; | ||
|
||
return targetUrl.Uri; | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 2 additions & 0 deletions
2
Web Services And Cloud/MovieInfoApp/MovieInfoApp/packages.config
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" /> | ||
<package id="Node.js" version="0.10.28" targetFramework="net45" /> | ||
<package id="NoGit" version="0.0.8" targetFramework="net45" /> | ||
</packages> |