public async Task <ActionResult <HealthViewResource> > PostAsync([FromServices] IPost post, [FromBody] HealthViewResource health)
 {
     log.LogInformation($"adding {health.Name} to the database");
     return(await TryTask <HealthViewResource> .Run(async() =>
     {
         await post.AddHealthResource(health);
         return Ok(health);
     }));
 }
Beispiel #2
0
 /// <summary>
 /// adds a health resource to the database
 /// </summary>
 /// <param name="input">input</param>
 /// <returns>updated item after adding</returns>
 public async Task AddHealthResource(HealthViewResource item)
 {
     item.Id = (await input.Add(item.ToData())).Id;
 }