// setup the configuration to edit the data registered as versioned in the egdb
var datastoreConfig = new DatastoreConfiguration(egdb, VersionState.Versioned);
// start the edit session on the workspace
var project = Project.Current;
var v_success = await project.SetSingleEditWorkspaceAsync(datastoreConfig);
// OR
// setup the configuration to edit the data that is not registered as versioned
var nonVersionedDatastoreConfig = new DatastoreConfiguration(egdb, VersionState.NonVersioned);
// start the edit session on the workspace
var nv_success = await project.SetSingleEditWorkspaceAsync(nonVersionedDatastoreConfig);