Ejemplo n.º 1
0
 public async Task <IActionResult> LinkZoneAsync([FromRoute] Zone parent, [FromBody] Zone child)
 {
     try
     {
         return(Ok(await _context.LinkZoneAsync(parent, child, new User()
         {
             UserID = Guid.Parse(User.Identity.Name)
         })));
     }
     catch (ArgumentException e)
     {
         return(BadRequest(new { error = e.Message }));
     }
 }