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, Using LS 4.0 in a MVC 3 app with the LightSpeedEntityModelBinder registered in Global.asax.cs I have one table/entity, "Sundays" which gets updated correctly with the following code
With this entity, Events the following code throws the error: "The model of type 'Bcsl.Models.Event' could not be updated." with this code:
I have checked both entitys in the Model diagram, and with the exception of the table and entity names their properties are identical. I've set Identity Column Name to Id and IdentityMethod to IdentityColumn in both Am I missing something else to check? Thanks James |
|
|
Hi James, This error is normally thrown by MVC when the form fields dont match the expected values for unbinding. If you use TryUpdateModel() instead of UpdateModel() does any data get updated?
|
|
|
Hi Jeremy, Ok, the TryUpdateModel() method works and updates the record. How can I find out what fields aren't correctly mapped? Thanks James |
|
|
Check the ModelState for errors (this should be getting populated the same as with UpdateModel but without the added exception being thrown). The return value of TryUpdateModel is your indicator if everything worked.
|
|