Skip to content

Instantly share code, notes, and snippets.

@jgable
Created March 24, 2011 14:42
Show Gist options
  • Save jgable/885169 to your computer and use it in GitHub Desktop.
Save jgable/885169 to your computer and use it in GitHub Desktop.
TeamServices - Team Services for the Team Hackatopia demo
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