public KitBrick Create(KitBrick newKb) { int id = _repo.Create(newKb); newKb.Id = id; return(newKb); }
internal int Create(KitBrick newKb) { string sql = @" INSERT INTO kitbricks (brickId, kitId, quantity) VALUES (@BrickId, @KitId, @Quantity); SELECT LAST_INSERT_ID();"; return(_db.ExecuteScalar <int>(sql, newKb)); }
public ActionResult <KitBrick> Post([FromBody] KitBrick newKb) { try { return(Ok(_service.Create(newKb))); } catch (Exception err) { return(BadRequest(err.Message)); } }
public ActionResult <Brick> Post([FromBody] KitBrick newBrick) { try { return(Ok(_kbs.Create(newBrick))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public int Create(KitBrick newKb) { string sql = @" INSERT INTO kitbricks (kitId, brickId) VALUES (@KitId, @BrickId); SELECT LAST_INSERT_ID();"; return(_db.ExecuteScalar <int>(sql, newKb)); }
public KitBrick Create(KitBrick newKitBrick) { string sql = @" INSERT INTO kitBricks (kitId, brickId) VALUES (@KitId, @BrickId); SELECT LAST_INSERT_ID()"; newKitBrick.Id = _db.ExecuteScalar <int>(sql, newKitBrick); return(newKitBrick); }
public KitBrick Create(KitBrick newKitBrick) { return(_repo.Create(newKitBrick)); }