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);
        }
Exemple #2
0
 public ActionResult <LeashRing> Post([FromBody] LeashRing newLeashRing)
 {
     try
     {
         return(Ok(_lrs.Create(newLeashRing)));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Exemple #3
0
 public LeashRing Create(LeashRing newLeashRing)
 {
     return(_repo.Create(newLeashRing));
 }