public virtual async Task <IActionResult> GetItemById(int id) { try { var service = await _businessLogicService.GetItemById(id).ConfigureAwait(false); return(service == null ? throw new Exception() : Ok(JsonConvert.SerializeObject(service))); } catch { return(NotFound($"{typeof(TBL).Name} with Id: {id} not found")); } }
public virtual async Task <IActionResult> GetItemById(string id) { try { Debug.WriteLine($"Try to get {typeof(TBL).Name} with Id: {id}"); var item = await _businessLogicService.GetItemById(id).ConfigureAwait(false); return(item == null ? throw new Exception() : Ok(JsonConvert.SerializeObject(item))); } catch { return(NotFound($"{typeof(TBL).Name} with Id: {id} not found")); } }