// GET api/<controller>
        public IHttpActionResult Get()
        {
            using (var personsBusiness = new PersonsBusiness())
            {
                // Get customers from business layer (Core App)
                List <Persons> persons = personsBusiness.SelectAllPersons();

                // Prepare a content
                var content = new ResponseContent <Persons>(persons);

                // Return content as a json and proper http response
                return(new StandartResult <Persons>(content, Request));
            }
        }
Example #2
0
 private List <PersonsEntity> ListAllPersons()
 {
     try
     {
         using (var Persons = new PersonsBusiness())
         {
             return(Persons.SelectAllPersons());
         }
     }
     catch (Exception ex)
     {
         //Log exception error
         _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);
     }
     return(null);
 }