Exemplo n.º 1
0
        public async Task <ActionResult <Vendor> > GetVendors()
        {
            try
            {
                var result = await Task.FromResult(vendorRepository.GetAllVendor());

                //throw new Exception("Exception while fetching...");
                logger.LogInformation("end");

                return(Ok(result));
            }
            catch (Exception ex)
            {
                logger.LogError($"Exception at Login Method: {ex}");
                return(StatusCode(500, "Internal server error"));
            }
        }
Exemplo n.º 2
0
        public IEnumerable <VendorDto> GetVendor(VendorDto vendordto)
        {
            try
            {
                VendorEntity vendorEntity = new VendorEntity
                {
                    login_entity = new LoginEntity
                    {
                        servername = vendordto.login_dto.servername,
                        username   = vendordto.login_dto.username,
                        password   = vendordto.login_dto.password,
                        dBname     = vendordto.login_dto.dBname
                    },
                };

                return(_mapper.Map <IEnumerable <VendorEntity>, IEnumerable <VendorDto> >
                           (_vendorRepository.GetAllVendor(vendorEntity)));
            }
            catch (Exception ex)
            {
                logCentral.Error("PODataAll", ex);
                throw;
            }
        }
Exemplo n.º 3
0
 public IActionResult ListAllVendor()
 {
     return(View(_ctx.GetAllVendor()));
 }