c# - ASP.Net WebApi Help Pages Sample Generation -


i'm using asp.net pages webapi. on of response format samples i'm receiving errors have formatter. i've looked @ various tutorials , seem show how override form-url-encoded format. haven't found override other formats:

application/json, text/json, text/html, application/xml, text/xml

in order set sample specific type used

 config.setsamplefortype("messagegoeshere", new           mediatypeheadervalue("application/x-www-form-urlencoded"), typeof(typegoeshere)); 

and worked set sample form-urlencoded response formats. tried replacing mediatypeheader value application/json or 1 of other examples , had no effect.

my question: how set samples response formats other form-urlencoded on asp.net pages?

the issue having was not using exact type in typeof parameter. using generic collection when should have been using iqueryable.

config.setsamplefortype("messagegoeshere", new       mediatypeheadervalue("application/json"), typeof(exacttypegoeshere)); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -