public FlowBo Create(FlowBo newFb) { int id = _repo.Create(newFb); newFb.Id = id; return(newFb); }
public int Create(FlowBo newFb) { string sql = @" INSERT INTO FlowBos (flowerId, boquetId) VALUES (@FlowerId, @BoquetId); SELECT LAST_INSERT_ID();"; return _fb.ExecuteScalar<int>(sql, newFb); }
public ActionResult <FlowBo> Post([FromBody] FlowBo newFb) { try { return(Ok(_service.Create(newFb))); } catch (Exception e) { return(BadRequest(e.Message)); } }