New Posts New Posts RSS Feed: An Editing Session (IEditableObject)
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

An Editing Session (IEditableObject)

 Post Reply Post Reply
Author
vbivona View Drop Down
Newbie
Newbie


Joined: 12-Jul-2011
Posts: 6
Post Options Post Options   Quote vbivona Quote  Post ReplyReply Direct Link To This Post Topic: An Editing Session (IEditableObject)
    Posted: 18-Jul-2011 at 1:01pm
I'm looking for a way to find out whether an editing session for an entity is open (if BeginEdit has been called)? I looked at EntityAspect and EntityState and didn't see anything. It looks like I can override Entity.BeginEditCore, Entity.EndEditCore and Entity.CancelEditCore to implement something if needed.
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 21-Jul-2011 at 9:58am

You could always check to see if EntityVersion.Default is the same as  EntityVersion.Proposed; until an editing session is started, it will instead be mapped to EntityVersion.Current. It might be easier to implement a new property as you've suggested, though, since it gives you one clear place to check.

Yours,
Robert
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 21-Jul-2011 at 10:21am
Actually, I've just realized that if you ask for EntityVersion.Proposed, when it hasn't been defined by starting an edit, you'll get EntityVersion.Default (which in that case will be EntityVersion.Current). Checking this clearly won't work, you'll have to implement what you suggested.
 
Sorry for the wrong information. It made sense, but it didn't seem to be working correctly when I tried it out, and when I checked teh documentation, I saw that I'd forgotten how EntityVersion handles undefined versions.
 
Yours,
Robert
Back to Top
vbivona View Drop Down
Newbie
Newbie


Joined: 12-Jul-2011
Posts: 6
Post Options Post Options   Quote vbivona Quote  Post ReplyReply Direct Link To This Post Posted: 22-Jul-2011 at 4:36pm
OK. Thanks very much, I'll set a flag in my object.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down