public NotableAstartes CreateNotableAstartes(NotableAstartes notableAstartes) { int id = _db.ExecuteScalar <int> (@"INSERT INTO notableAstartes (img, name, story, legion, primarch, isLoyal) VALUES (@Img, @Name, @Story, @Legion, @Primarch, @IsLoyal); SELECT LAST_INSERT_ID();", notableAstartes); notableAstartes.Id = id; return(notableAstartes); }
public ActionResult <NotableAstartes> Post([FromBody] NotableAstartes notableAstartes) { try { return(Ok(_repository.CreateNotableAstartes(notableAstartes))); } catch (Exception e) { return(BadRequest(e.Message)); } }