public async Task <IActionResult> AddDemand([FromBody] AppDemand model) { if (ModelState.IsValid) { try { logger.LogInformation("Adding Demand in the Repository"); var addedDemand = await demandRepo.AddProductDemand(model); if (addedDemand != null) { return(Ok(addedDemand)); } else { return(NotFound()); } } catch (Exception excp) { logger.LogError("Error in adding Demand in the Repository " + excp.Message); return(BadRequest(excp)); } } return(BadRequest()); }