Beispiel #1
0
        public async Task <IActionResult> GetEnterprise(int id)
        {
            EnterpriseDTO Enterprise = await _enterpriseService.GetEnterprise(id);

            var response = new ApiResponse <EnterpriseDTO>(Enterprise);

            return(Ok(response));
        }
        public async Task <IActionResult> GetEnterprise(int id)
        {
            if (!User.Identity.IsAuthenticated)
            {
                throw new AuthenticationException();
            }
            var enterprise = await _enterpriseService.GetEnterprise(id);

            var enterpriseDto = _mapper.Map <EnterpriseDto>(enterprise);
            var response      = new ApiResponse <EnterpriseDto>(enterpriseDto);

            return(Ok(response));
        }
 public ActionResult <EnterpriseModel> GetEnterprise(int id)
 {
     try
     {
         return(Ok(service.GetEnterprise(id)));
     }
     catch (NotFoundException ex)
     {
         return(NotFound(ex.Message));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
     }
 }
Beispiel #4
0
 public ActionResult Edit(Guid id)
 {
     return(View(service.GetEnterprise(id)));
 }