Created
October 29, 2020 10:52
-
-
Save mr5z/14d3023934f4bacc80c5c01d09288964 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
public async Task<ActionResult<Cave>> PostCave([FromBody]CaveDto cave) | |
{ | |
context.Point.Add(new Point | |
{ | |
}); | |
context.Path.Add(new Path | |
{ | |
}); | |
context.Map.Add(new Map | |
{ | |
}); | |
context.Cave.Add(new Cave | |
{ | |
DeviceOrigin = cave.DeviceOrigin, | |
DateCreated = cave.DateCreated, | |
Duration = cave.Duration, | |
EndPointRadius = cave.EndPointRadius, | |
Name = cave.Name, | |
ShowJumpScare = cave.ShowJumpScare, | |
AuthorId = cave.Author.Id, // generated from client side | |
MapId = cave.Map.Id, // TODO | |
PathId = cave.Path.Id, // TODO | |
}); | |
await context.SaveChangesAsync(); | |
return CreatedAtAction("GetCave", new { id = cave.Id }, cave); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment