// GET api/<controller>/5 public IHttpActionResult Get(int id) { using (var personsBusiness = new PersonsBusiness()) { Persons person = personsBusiness.SelectPersonById(id); List <Persons> persons = new List <Persons>(); persons.Add(person); var content = new ResponseContent <Persons>(persons); return(new StandartResult <Persons>(content, Request)); } }
private PersonsEntity SelectPersonById(int id) { try { using (var Persons = new PersonsBusiness()) { return(Persons.SelectPersonById(id)); } } catch (Exception ex) { //Log exception error _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true); } return(null); }