public async Task <IActionResult> GetDemandInfo(Guid?demandId) { if (demandId == null) { return(BadRequest()); } try { logger.LogInformation("Getting Single Demand from Repository"); var selectedDemand = await demandRepo.GetDemandInfo(demandId); if (selectedDemand == null) { return(NotFound()); } return(Ok(selectedDemand)); } catch (Exception excp) { logger.LogError("Error in fetching demand from repository " + excp.Message); return(BadRequest(excp)); } }