CancelEdit not supported on EditableRootList?

CancelEdit not supported on EditableRootList?

Old forum URL: forums.lhotka.net/forums/t/1575.aspx


davem1958 posted on Tuesday, October 24, 2006

I'm writing some unit tests for a collection of root objects.  It appears that "CancelEdit" is not supported on an EditableRootList.  Is that correct?  The error message is:

IncidentListCancelEdit : System.NotSupportedException : Invalid for root objects - use Delete instead.

Thanks!

davem1958 replied on Tuesday, October 24, 2006

My last post might have been a little vague.  Here's the code.  Should this run OK, or should it throw an error "NotSupportedException"?  The Incident is an EditableRoot object, and the IncidentList is an EditableRootList.

 

  [Test]
  public void IncidentListCancelEdit()
  { 
   IncidentList IncidentList = IncidentList.NewIncidentList();
   Incident incident = Incident.NewIncident();
   IncidentList.BeginEdit();
   IncidentList.Add(incident);
   IncidentList.CancelEdit();
  }

Copyright (c) Marimer LLC