Created
January 13, 2015 15:13
-
-
Save hanssens/4167b97dde1e294f8f1e to your computer and use it in GitHub Desktop.
Dynamic parameter in WebAPI controller.
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
public class QuotesController : ApiController | |
{ | |
/// <summary> | |
/// Expects filter.quote to have a string value... | |
/// </summary> | |
public string Get([FromUri]dynamic filter) | |
{ | |
var raw_json = JsonConvert.DeserializeObject(filter); | |
return raw_json.quote.ToString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment