public IActionResult List() { IEnumerable <ElementDto> elementsDto; try { elementsDto = _elementService.Get(); } catch (Exception ex) { return(RedirectToAction(actionName: "Index")); } return(View(elementsDto)); }
public Response <IEnumerable <ElementDto> > Get() { Response <IEnumerable <ElementDto> > response = new Response <IEnumerable <ElementDto> >(); try { response.Object = _elementService.Get(); } catch (Exception ex) { response.Errored = true; response.ErrorMessage = ex.Message; _logger.LogError($"{typeof(ElementController).FullName}.{nameof(Get)}", null); } return(response); }
public async Task <CW_Element> Get(string documentTitle, string uniqueId) { var result = await m_elementService.Get(documentTitle, uniqueId); return(result.FirstOrDefault()); }