// GET api/values/5 public ContactDetailsDto Get(int id) { if (id == 0) { throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, "id can not be null")); } var result = _contactRepo.FindById(id); return(result); }
public ActionResult <Contact> FindById(long id) { Console.WriteLine($"Find contact by {id}"); return(_repo.FindById(id)); }