I have the following code which takes in a object of type employee based on it's model, I want to convert this to a DocumentDB Document then post to the database. How would I do the conversion?
[HttpPost]
public async Task Post([FromBody]Employee employee)
{
using (_logger.BeginScope("Post employee"))
{
try
{
// convert employee to Document??
await _documentDbRepository.CreateItemsAsync(document);
}
catch (Exception e)
{
_logger.LogError(e.Message);
throw;
}
}
}