1
Reply

Create generic response for API

Arvind Singh Baghel

Arvind Singh Baghel

Feb 10 2017 12:41 AM
484
I am creating a WCF service, which has many classes and many methods like GetCustomer, SaveCustomer, SaveTransaction etc.  when we consume this service and call any method i want to return a generic response message. e.g. if i call SaveCustomer then in my response i want to send responseCode=SUC (its for request is successfuly came or not) result=Accepted, responseMessage="Customer data saved" so i created class like blow:
public string result { get; set; }
public string responseCode { get; set; }
public string responseMessage { get; set; }
 and want to return that customer or transaction object also, if customer object came in request then my above class object plus customer that object if transaction object came then my above class object plus that trasaction object. there are many other classes also
 
thanks 

Answers (1)