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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -