public IActionResult Person(int?id)
        {
            PersonDto output = null;

            if (id.HasValue)
            {
                output = _personAppService.GetById(id.Value);
            }
            return(View(output));
        }
        public async Task <IActionResult> Edit(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var personViewModel = await _personAppService.GetById(id.Value);

            if (personViewModel == null)
            {
                return(NotFound());
            }

            return(View(personViewModel));
        }
Пример #3
0
        public IActionResult GetById(int id)
        {
            var person = _personAppService.GetById(id);

            var personMapped = Mapper.Map <Models.Person>(person);

            return(Ok(person));
        }
        public IActionResult Details(long?id)
        {
            try
            {
                if (id == null)
                {
                    return(NotFound());
                }

                var person = _personAppService.GetById(id.Value);

                if (person == null)
                {
                    return(NotFound());
                }

                return(Ok(person));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return(BadRequest("Error while processing your request!"));
            }
        }
Пример #5
0
        public IActionResult GetById(int id)
        {
            var personViewModel = personAppService.GetById(id);

            return(Response(personViewModel));
        }
Пример #6
0
 public async Task <PersonViewModel> Get(Guid id)
 {
     return(await _personAppService.GetById(id));
 }
Пример #7
0
        public IActionResult Get(Guid id)
        {
            var viewModel = _personAppService.GetById(id);

            return(Response(viewModel));
        }