public static void SaveRequestResponse(RequestResponseLog obj) { try { using (var dc = new InterswitchNameEnquiryEntities()) { dc.RequestResponseLogs.Add(obj); dc.SaveChanges(); } } catch (Exception e) { Utils.LogError(e, "SaveRequestResponse"); } }
public static void SaveRequestResponse(string customerId, NameEnquiryResponseResult response) { try { var jsonResp = JsonConvert.SerializeObject(response); using (var dc = new InterswitchNameEnquiryEntities()) { var obj = new RequestResponseLog(); obj.RequestBody = customerId; obj.RequestTime = DateTime.Now; obj.ResponseBody = jsonResp; obj.ResponseTime = DateTime.Now; dc.RequestResponseLogs.Add(obj); dc.SaveChanges(); } } catch (Exception e) { Utils.LogError(e, "SaveRequestResponse"); } }