Home  /  Questions  /  Question

Sep 17, 2013

Spark's Core.cs. Where does sqlSelect get populated

Hi There,

I'm busy  messing around with Spark. Great job, by the way!

I've created my own project and reproduced the required classes and layout but when I call the Single method e.g:
var people= MyContext.People.Single(where: "FirstName = @0", parms: "Joe");

It calls the CreateSelect method in the Core class, in this method the sqlSelect variable does not contain the column names e.g.:
SELECT {0}  FROM [Person] {1} {2}

In the sample app this variable does contain the column names.
Where is this variable assigned to? I'm sure I missed something : )

Thank you!

Sep 17, 2013
I am answering my own question here. The reason the sqlSelect variable was not populated was because my objects name was Person and the table name is called People.

In the InitMap method inside the Core class it tries to select all columns for a table called Person rather than People.
 1 comment
By the way this was my own fault : ) Spark conventions dictates that table names should be singular --- Pieter van der Westhuizen  Sep 17, 2013