public IHttpActionResult GetContactById(int id) { ContactEntity contacts = _ContactServices.GetContactById(id); if (contacts != null) { return(Ok(contacts)); } return(BadRequest("Contacts not found for ID : " + id)); }
// GET api/Contact/id public HttpResponseMessage Get(int id) { var contacts = _contactServices.GetContactById(id); if (contacts != null) { return(Request.CreateResponse(HttpStatusCode.OK, contacts)); } return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Contacts not found for ID : " + id)); }
// GET api/contact/2 public HttpResponseMessage Get(int id) { var contact = _contactServices.GetContactById(id); if (contact != null) { return(Request.CreateResponse(HttpStatusCode.OK, contact)); } return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No contact found for this id")); }
// GET: api/Contact/5 /// <summary> /// Get Contact By Contact ID /// Created Date: 10 Apr 2018 /// Created By : Omkar M. /// </summary> /// <param name="id"></param> /// <returns></returns> public IHttpActionResult GetContact(int id) { var product = _contactServices.GetContactById(id); if (product == null) { return(NotFound()); } return(Ok(product)); }
public ActionResult <ContactModel> GetContactDetailById(int Id) { var result = _contactServices.GetContactById(Id); if (result.Id != 0) { return(Ok(result)); } return(NotFound(result)); }
// GET: Home/Edit/5 public ActionResult Edit(int id) { VMContact Contacts = null; try { Contacts = _contactServices.GetContactById(id); } catch (Exception) { } return(PartialView(Contacts)); }