0
I'm building an ASMX webservice on .NET 4.5 and due to the way it's structured, it's hard to add something like HttpContext.Current.Response.Status to my API response, instead I'd prefer to return something like this
{'status': 'success', 'error_message': '', 'data': [{object1}, {object2},{etc}]}
or {'status': 'fail', 'error_message': 'Error Occured', 'data' = []}
I see this format a lot but I've never seen a way to create it in C#, other than hardcoding it or creating multiple classes. How can I achieve a format like this in .NET?