public async Task<ActionResult> Index(List<ReferenceModel> model)
 {
     if (ModelState.IsValid)
     {
         bool referencesStored = false;
         using (var client = new DataServiceClient())
         {
             client.Open();
             var references = new List<Reference>();
             foreach (var refer in model)
             {
                 var temp = new Reference();
                 temp.applicantId = Convert.ToInt32(this.Session["ApplicantId"]);
                 temp.company = refer.company;
                 temp.name = refer.name;
                 temp.phone = refer.phone;
                 temp.title = refer.title;
                 temp.applicantId = refer.applicantId;
                 temp.referenceId = refer.referenceId;
                 references.Add(temp);
             }
             referencesStored = await client.updateReferencesAsync(references.ToArray());
             client.Close();
         }
         if (referencesStored) 
         {
             this.Session["Reference"] = "Done";
             return RedirectToAction("Index", "ESignature");
         }
         else
         {
             //error has occured storing references.
         }
     }
     return View(model);
 }