Skip to content

Instantly share code, notes, and snippets.

@btompkins
Created December 14, 2012 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btompkins/4281997 to your computer and use it in GitHub Desktop.
Save btompkins/4281997 to your computer and use it in GitHub Desktop.
public class Location
{
public double Latitude { get; set; }
public double Longitude { get; set; }
}
public class LocationProcessor : Processor<string, string, Location>
{
public LocationProcessor()
{
this.OutArguments[0].Name = "Location";
}
public override ProcessorResult<Location> OnExecute( string latitude, string longitude)
{
var lat = double.Parse(latitude);
var lon = double.Parse(longitude);
return new ProcessorResult<Location> { Output = new Location { Latitude = lat, Longitude = lon } };
}
}
[ServiceContract]
public class MapResource {
[UriTemplate="{latitude},{longitude}"]
public Stream Get(Location location) {
//return the map
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment