In my Rest WCF project I am saving data to DB. My question is when the user sends data to my wcf service, I need to validate the data and if there is any error how can I inform it back to the user? And once data is s开发者_如何学Cuccessfully saved to Database , I need to send a confirmation to the user saying "Data successfully saved". How can I do this. Thanks in advance for your help.
Use the HttpStatusCode:
WebOperationContext context = WebOperationContext.Current;
context.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.OK;
精彩评论