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")); } }
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; } }
public IActionResult ListAllVendor() { return(View(_ctx.GetAllVendor())); }