This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi,
I am trying to do an update query and I am getting the following error: Query Error: Could not find field [IsValid] on model [Application]
Obviously I have to do some sort of validation or something as the IsValid property on the entity is read only..
private int Update(Application application, int? id) |
|
|
Hmm, this is because when you pass an object to an Update(Query, object) it tries to use *all* the properties of the object as columns in the update. That includes base class properties. So in this case it is picking up the IsValid property from Application's Entity base class, and trying to treat it as a data attribute. Which is clearly not appropriate. (And performing the validation won't help because the problem is the presence of the IsValid property, not its value.) I'll see if we can get this fixed to exclude Entity-defined properties in update queries. Thanks for drawing our attention to this. |
|
|
Thanks Ivan
|
|
|
Okay, this will be fixed in the 3 July nightly, available from about 1430 GMT. Thanks again for reporting this and please let us know if you run into any further problems with it! |
|
|
Thanks Ivan,
Also, will that fix this? public void Delete(int id) |
|
|
The error being for what I previously posted:
Could not find field [PageId] on model [Page]
|
|
|
No, that looks like there's a problem with the query. Does your Page class have a PageId property? Are you sure this shouldn't be Entity.Attribute("Id") instead? Entity.Attribute must always specify the *entity* property name: LightSpeed will take care of translating this to the database column name if required. (This may affect your update query as well -- if ApplicationId is meant to be the identity then it needs to be "Id".) |
|