Example #1
0
        /// <summary>
        /// This method posts data sent from front-end to client
        /// </summary>
        /// <param name="request">payload details</param>
        /// <returns>status of request</returns>
        public string PostData(MyRequest request)
        {
            //generate unique id
            var requestId = Guid.NewGuid().ToString();

            //call client to post data (having client object might be overkill for this exercise but in real app it would be recommended)
            var status = MyClientBusinessLogic.StartPostingProcess(MyClient, request, requestId);

            //saving request details in db
            Repository.SaveUpdateMyRequest(request.ToDBRequestModel(requestId, status));

            //returning result back to caller
            return(status);
        }