internal SetLego Create(SetLego newData) { string sql = @" INSERT INTO setlegos (legoId, setId) VALUES (@LegoId, @SetId); SELECT LAST_INSERT_ID(); "; int id = _db.ExecuteScalar <int>(sql, newData); newData.Id = id; return(newData); }
internal SetLego Find(SetLego sl) { string sql = "SELECT * FROM setlegos WHERE (legoId = @LegoId AND setId = @SetId)"; return(_db.QueryFirstOrDefault(sql, sl)); }