Created
February 28, 2013 15:28
-
-
Save KennyEliasson/5057544 to your computer and use it in GitHub Desktop.
Kommer mappa till /kenny (om det är Get) kan populera via JSON/XML anrop etc.
ResponseStatus fylls i själv om det uppstår fel (kan i debug skicka med hela stacktracen) De har med klienter out of the box -> _client.Get(new Kenny()); t.e.
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
[Route("kenny")] | |
public class Kenny | |
{ | |
public string Name { get; set; } | |
public int Id { get; set; } | |
public List<string> Data { get; set; } | |
public CustomClass Custom { get; set; } | |
} | |
public class CustomClass | |
{ | |
public string Number { get; set; } | |
} | |
public class KennyResponse | |
{ | |
public string Message { get; set; } | |
public int Created { get; set; } | |
public List<string> AwesomeStuff { get; set; } | |
public CustomClass Metadata { get; set; } | |
public ResponseStatus Status { get;set; } | |
} | |
public class KennyService : Service | |
{ | |
public object Get(Kenny request) | |
{ | |
return new KennyResponse() | |
{ | |
AwesomeStuff = new List<string>() { "Ko", "Gris" }, | |
Created = 123, | |
Metadata = new CustomClass() { Number = "123411111" }, | |
Message = "Det funkar! :)" | |
}; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment