Hmm.... Don't want to update. We're adding a record, and the ID is
provided by the user. (Not autogenerated.)

I have a controllet that all the objects use that saves the data like
this:
_saveData.Invoke(DataObject)
DataObject.UpdatedBy = UserName
DataObject.UpdatedOn = DateTime.Now

If ErrorList.Count = 0 Then
        DataObject.SaveAndFlush()

It's at the SaveAndFlush that things crash... the DataObject seems to
load ok. I can look at it in debugger right before the flush and
things are in there correctly as far as I can tell. The Badge object
has an address object that has an ID of 0, since it is also new.

How does the SaveAndFlush know whether my object is new or exists and
needs to be updated?

Also, I tried changing the Badge.ID declaration lik this:
[PrimaryKey(PrimaryKeyType.Assigned, Column = "BadgeID")]
public override int ID
{
        get { return base.ID; }
        set { base.ID = value; }
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to