Esempio n. 1
0
        public IActionResult List()
        {
            IEnumerable <ElementDto> elementsDto;

            try
            {
                elementsDto = _elementService.Get();
            }
            catch (Exception ex)
            {
                return(RedirectToAction(actionName: "Index"));
            }
            return(View(elementsDto));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public async Task <CW_Element> Get(string documentTitle, string uniqueId)
        {
            var result = await m_elementService.Get(documentTitle, uniqueId);

            return(result.FirstOrDefault());
        }