This website is intended as archive for old content and forums.
Please visit http://opf3.codeplex.com for the project's new website.

General Discussion

FORUM TOPIC

What is Opf3? Why is Opf3? How is Opf3? All these burning questions and issues discussed here.

RSS
Thomas W. Tucker
Posted on the 04/21/08 4:10 PM
Existing Item
Reply Quote
 Is there a way to tell OPF that an object already exists in the Database and to update it and not insert it when you persistchanges?

Christian Liensberger [Moderator]
Posted on the 04/21/08 5:25 PM
RE: Existing Item
Reply Quote
 Hi Thomas,

there would be a walk around that. You can mark all the properties of the persistent object as DontUpdate (PersistBehaviour property of the FieldAttribute). In that case no update would run if none of them is updateable.

Otherwise you would need to check it manually first.

Christian

Thomas W. Tucker
Posted on the 04/21/08 5:27 PM
RE: Existing Item
Reply Quote
 I Want it to update
I dont want it to be inserted

Christian Liensberger [Moderator]
Posted on the 04/21/08 5:37 PM
RE: Existing Item
Reply Quote
 You could also use the GetObjectInfo method of the ObjectContext and set the ObjectState to Inserted! In that case Opf3 will try an update instead of an insert.

Christian

Thomas W. Tucker
Posted on the 04/21/08 5:40 PM
RE: Existing Item
Reply Quote
 Thanks

All times are in GMT.