/// <summary>
 /// Saves a <see cref="WorkflowConfigurationContainer"/>.
 /// </summary>
 /// <param name="workflowConfiguration">The <see cref="WorkflowConfigurationContainer"/> to save.</param>
 /// <returns>The saved <see cref="WorkflowConfigurationContainer"/>.</returns>
 public WorkflowConfigurationContainer SaveWorkflowConfiguration(WorkflowConfigurationContainer workflowConfiguration)
 {
     return this.DoSaveWorkflowConfiguration(workflowConfiguration);
 }
        /// <summary>
        /// Saves a <see cref="WorkflowConfigurationContainer"/>.
        /// </summary>
        /// <param name="workflowConfiguration">The <see cref="WorkflowConfigurationContainer"/> to save.</param>
        /// <returns>The saved <see cref="WorkflowConfigurationContainer"/>.</returns>
        protected override WorkflowConfigurationContainer DoSaveWorkflowConfiguration(WorkflowConfigurationContainer workflowConfiguration)
        {
            MongoCollection<BsonDocument> collection = this.Database.GetCollection(iApplyDb.WorkflowConfiguration._COLLECTION_NAME);
            BsonDocument document = BsonConverter.ConvertToBsonViaJson(workflowConfiguration);

            var result = collection.Save(document);

            if (result.Ok)
            {
                return workflowConfiguration;
            }

            throw new MongoException(result.LastErrorMessage);
        }
 /// <summary>
 /// Saves a <see cref="WorkflowConfigurationContainer"/>.
 /// </summary>
 /// <param name="workflowConfiguration">The <see cref="WorkflowConfigurationContainer"/> to save.</param>
 /// <returns>The saved <see cref="WorkflowConfigurationContainer"/>.</returns>
 protected abstract WorkflowConfigurationContainer DoSaveWorkflowConfiguration(WorkflowConfigurationContainer workflowConfiguration);