public async Task <ActionResult> ImportPedigree() { Guid sampleId = Guid.Parse(Request["sampleId"]); string analysisRequestId = Request["analysisRequestId"]; Guid guidAnalysisRequestId = Guid.Parse(analysisRequestId); List <GNSampleRelationship> sampleRelationships = db.GNSampleRelationships.Where(t => t.GNLeftSampleId.Equals(sampleId)).ToList(); foreach (GNSampleRelationship sampleRel in sampleRelationships) { if (db.GNAnalysisRequestGNSamples.Count(t => t.GNAnalysisRequestId == guidAnalysisRequestId && t.GNSampleId == sampleRel.GNRightSample.Id) == 0) { SampleService ss = new SampleService(db, identityDB); int result = await ss.AddSampleToAnalysisRequest(sampleRel.GNRightSample.Id, analysisRequestId); } } return(RedirectToAction("Edit", "AnalysisRequests", new { id = analysisRequestId })); }