public Contact Create(Contact instance)
 {
     instance.ModifyDate = DateTime.Now;
       _contactRepository.InsertOrUpdate(instance, "api");
       _contactRepository.Save();
       return instance;
 }
 public ActionResult Create(Contact contact)
 {
     if (ModelState.IsValid)
       {
     _contactRepository.InsertOrUpdate(contact, base.User.Identity.Name);
     _contactRepository.Save();
     if (Request.IsAjaxRequest())
     {
       return Json(contact, JsonRequestBehavior.AllowGet);
     }
     return RedirectToAction("Index");
       }
       else
       {
     return View();
       }
 }
 public Contact Update(string id, Contact instance)
 {
     _contactRepository.InsertOrUpdate(instance, "api");
       _contactRepository.Save();
       return instance;
 }