Search code examples
c#wcf-ria-services

How to identify if IEditableObject is in edit status?


When implement IEditableObject for an entity in wcf ria service, how can I know if the entity in Edit status(for example, Begin() is starting)?


Solution

  • IEditableObject implements only 3 methods (BeginEdit, CancelEdit and EndEdit), so it will be impossible to detect whether the object is in edit mode, without a custom implementation.

    You can for instance, implement an IsInEdit property, which you set to true in BeginEdit and false in CancelEdit and EndEdit.