Dofactory.com
Dofactory.com
 Back to list
Views:   5.2K
Replies:  1
Archived

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!
Pieter van der Westhuizen, Sep 17, 2013
Reply 1
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.
Pieter van der Westhuizen, Sep 17, 2013
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.