public Angels CreateAngels(Angels angels) { int id = _db.ExecuteScalar <int> (@"INSERT INTO angels (img, name, title, history) VALUES (@Img, @Name, @Title, @History); SELECT_LAST_INSERT_ID();", angels); angels.Id = id; return(angels); }
public ActionResult <Angels> Post([FromBody] Angels angels) { try { return(Ok(_repository.CreateAngels(angels))); } catch (Exception e) { return(BadRequest(e.Message)); } }