コード例 #1
0
        public IActionResult Person(int?id)
        {
            PersonDto output = null;

            if (id.HasValue)
            {
                output = _personAppService.GetById(id.Value);
            }
            return(View(output));
        }
コード例 #2
0
        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
ファイル: PersonController.cs プロジェクト: rlima05/CrudApi
        public IActionResult GetById(int id)
        {
            var person = _personAppService.GetById(id);

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

            return(Ok(person));
        }
コード例 #4
0
        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));
        }