Saturday, April 18, 2015

method overloading at Web API Controllers to accommodate old versions of Internet Explorer

...looks like this:

public bool Post(Foo foo)
{
   return Bottleneck(foo);
}
 
public bool Get(Foo foo)
{
   return Bottleneck(foo);
}
 
public bool Get(string param)
{
   var foo = JsonConvert.DeserializeObject<Foo>(param);
   return Bottleneck(foo);
}

 
 

IE9 and less will only be able to interface with the last of these. DeserializeObject will need the Newtonsoft.Json namespace as a using directive.

No comments:

Post a Comment