Skip to content

Instantly share code, notes, and snippets.

@kshitijcode
Created July 9, 2021 04:53
Show Gist options
  • Select an option

  • Save kshitijcode/6a561cd0422df59dfe1bccfea4d0cc7d to your computer and use it in GitHub Desktop.

Select an option

Save kshitijcode/6a561cd0422df59dfe1bccfea4d0cc7d to your computer and use it in GitHub Desktop.
[HttpPost]
[Route("/saveWeatherState")]
public async Task<IActionResult> Post([FromBody] WeatherChange weatherChange)
{
try
{
await _daprClient.SaveStateAsync("mongo", "admin", weatherChange);
}
catch (Exception e)
{
return BadRequest();
}
return Ok();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment