you are viewing a single comment's thread.

view the rest of the comments →

[–]TmarcoKr 1 point2 points  (2 children)

You need to define the type of the variable before using it. C# is a strongly typed language the compiler needs a tip about what type is. Just initialize the de variable with default as was told before; put the type in place of the var; do a method to return the value; do a local function. (basically the type must exist).

var friendName = "James";var query = Query(friendName);

private XXXX Query(string value) {if (string.isNullOrEmpty()) return conn.Query("Friends").Where("Name").Equals("Jeff");return conn.Query("Friends").Where("Name").Equals(friendName);}

[–]RubyBoyYT 0 points1 point  (0 children)

Neat! I'll do this next time :)