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 have a simple application and database schema, which has a problem I can't figure out. The database schema is such The LightSpeed Model looks like this My code creates a book, then adds the book to the Member which is passed into the method.
An exception is thrown when calling unitOfWork.SaveChanges()
This code should work, but doesn't. I have looked through the properties of each of the entities and don't see anything that catches my eye. Any suggestions and advice would be much appreciated. Thanks, James |
|
|
Hi James, Nothing wrong with the code itself, but the member you are assigning it to has a Review associated which does not have a Book assigned causing it to be invalid, which in turn causes your Member to be invalid, which in turn causes your newly added Book to be invalid. The object [Book [Ide=-2, EntityState=New]] could not be save because it is invalid. The errors are:
|
|