private void SaveUpdateRequestInformation(ResponseDetails response, GCTSC_ChangeTracking ctRecord) { GCTSC_ChangeTracking_UpdateRequests updateRequest = new GCTSC_ChangeTracking_UpdateRequests() { ChangeTrackingId = ctRecord.Id, Change = response.SendRequest.ToString(), ResponseCode = response.SendResponse.ToString(), ResponseContent = response.ResponseContent, URL = response.URL }; using (RiftEntities context = new RiftEntities()) { try { context.GCTSC_ChangeTracking_UpdateRequests.Add(updateRequest); context.SaveChanges(); } catch (Exception ex) { throw ex; } } }
private void CheckForChangeTrackingUpdateRequest() { using (RiftEntities context = new RiftEntities()) { GCTSC_ChangeTracking ctRecord = (from ct in context.GCTSC_ChangeTracking.Where(ct => ct.Accountno == _roTestHelper._testAccountno) select ct).FirstOrDefault(); if (ctRecord == null) { throw new ArgumentNullException("ctRecord"); } else { GCTSC_ChangeTracking_UpdateRequests cturRecord = (from ctur in context.GCTSC_ChangeTracking_UpdateRequests.Where( ctur => ctur.ChangeTrackingId == ctRecord.Id && ctur.ResponseCode == "OK" && ctur.Change == "LASTNAME" && ctur.ResponseContent.Contains(@"{""id"":1,""first_name"":""TestChange"",""goldmine_customer_number"":165992") ) select ctur).FirstOrDefault(); Assert.IsTrue(cturRecord != null); } } }