Hello,
I'm having an issue with default values in an entity - the entity is not being saved correctly to the database.
I'm declaring an object as follows:
Dim MyEntityObject As New MyEntity(Now.Year, Now.Month, Now.Day, Now.Hour, Key)
Assuming MyEntity does not exist in the database, it will return a new instance - this is working correctly.
Now if I go (assuming the entity did not existing in the database)
MyEntityObject.SomeValue = 1
MyEntityObject.Save
This will throw an exception. I inspected the SQL code, the fields, like Year, Month, Day, Year are not being sent to the database. The entity believes them to be defaults and not "new" / "dirty" fields.
I need to reassign all the fields for the entity to be saved.
My question is: if an entity is marked as new, why arne't all the fields being sent to the database?
Thanks.