Created
March 24, 2011 14:42
-
-
Save jgable/885169 to your computer and use it in GitHub Desktop.
TeamServices - Team Services for the Team Hackatopia demo
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
using System; | |
using System.Collections.Generic; | |
public class HelloWorldService : JsonService<HelloWorldResponse> | |
{ | |
private static string Url = "http://localhost:59527/Team"; | |
public void GetHello(Action<HelloWorldResponse> onResult, Action<Exception> onError) | |
{ | |
StartServiceCall(Url, onResult, onError); | |
} | |
} | |
public class TeamListService : JsonService<TeamListResponse> | |
{ | |
private static string Url = "http://localhost:59527/Team/List"; | |
public void GetTeams(Action<TeamListResponse> onResult, Action<Exception> onError) | |
{ | |
StartServiceCall(Url, onResult, onError); | |
} | |
} | |
public class TeamGetService : JsonService<TeamGetResponse> | |
{ | |
private static string Url = "http://localhost:59527/Team/Id/{0}"; | |
public void GetTeam(int id, Action<TeamGetResponse> onResult, Action<Exception> onError) | |
{ | |
StartServiceCall(string.Format(Url, id), onResult, onError); | |
} | |
} | |
public class TeamSearchService : JsonService<TeamSearchResponse> | |
{ | |
private static string Url = "http://localhost:59527/Team/Search/{0}"; | |
public void SearchTeams(string searchTerm, Action<TeamSearchResponse> onResult, Action<Exception> onError) | |
{ | |
StartServiceCall(string.Format(Url, searchTerm), onResult, onError); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment