It looks like your EntityEditorController has not been passed the workitem that it controls or its workitem does not have an Id assigned.
How are you creating your editor? Are you using the EntityEditorService?
The EntityEditorService contains (amongst a lot of other code) this method:
/// <summary>
/// Make a new Editor instance (to edit existing or new entity)
/// given the type of an Editor to make
/// that is not mapped to another type.
/// </summary>
private IEntityEditorController MakeUnmappedEditor<TEditor>()
where TEditor : IEntityEditorController {
ControlledWorkItem<TEditor> editorWorkItem =
WorkItem.WorkItems.AddNew<
ControlledWorkItem<TEditor>>();
IEntityEditorController editor = editorWorkItem.Controller;
EditorKeys.Add(
new EditorKey(editor));
return editor;
}
If you're not using the EntityEditorService, your command handler will need to do something similar.
(The line adding the new EditorKey is of course only needed in the service implementation).
Bill J.