DataChomp

Chomping At The Bits

Massive and Using Multiple Args:

So, in Rob Conery’s example of using multiple args in a query

var tbl = new Products();
var products = tbl.All(where: "CategoryID = @0 AND UnitPrice > @1", orderBy: "ProductName", limit: 20, args: 5,20);

It makes the args appear to be this completely bad ass and intelligent command that knows exactly when and where to parse/apply the values. Well, in the real world versions of Massive the compiler doesn’t take to kindly to that sort of syntax.

args: is a parameter of type object [] so the way I use multiple params is as follows:

object[] queryargs = {"Okapi", "online"};
var DBBasics = table.All(where: "WHERE ServerName=@0 and status = @1", args: queryargs );

and low and behold the magic happens.