예제 #1
0
        public virtual async Task <IActionResult> GetAllItems()
        {
            try
            {
                var services = await _businessLogicService.GetAllItems().ConfigureAwait(false);

                return(Ok(JsonConvert.SerializeObject(services)));
            }
            catch (Exception exception)
            {
                return(StatusCode(500, exception.Message));
            }
        }
예제 #2
0
 public virtual IActionResult GetAllItems()
 {
     try
     {
         Debug.WriteLine($"Try to get all {typeof(TBL).Name} items");
         var items = _businessLogicService.GetAllItems();
         return(Ok(JsonConvert.SerializeObject(items)));
     }
     catch (Exception exception)
     {
         return(StatusCode(500, exception.Message));
     }
 }