Link to home
Start Free TrialLog in
Avatar of yadavdep
yadavdepFlag for India

asked on

.NET core web API response structure or format

I am building a Web API in Asp.net core.
This service will be json service and I was given a fixed structure in which all the web API method should return their response results show as below.

I need to know is what be the best way of implementing this.
One option is I create with properties ( same needed for response) and return that as response and set values in its properties.

Or is there any other way as well. Please let me know
 
{
	Data: {Result object },
	Status: true | false
	code: 1 | 2 | 3
	Message: “Any error Message”
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial