internal LeashRing Create(LeashRing newLeashRing) { string sql = @"INSERT INTO LeashRings (manufacturerid, name, img, manufacturer, componenttype, material, weight, wll, mbs, materialdiameter, innerdiameter, outerdiameter, price) VALUES (@manufacturerid, @name, @img, @manufacturer, @componenttype, @material, @weight, @wll, @mbs, @materialdiameter, @innerdiameter, @outerdiameter, @price); SELECT LAST_INSERT_ID();"; newLeashRing.Id = _db.ExecuteScalar <int>(sql, newLeashRing); return(newLeashRing); }
public ActionResult <LeashRing> Post([FromBody] LeashRing newLeashRing) { try { return(Ok(_lrs.Create(newLeashRing))); } catch (Exception err) { return(BadRequest(err.Message)); } }
public LeashRing Create(LeashRing newLeashRing) { return(_repo.Create(newLeashRing)); }