Example #1
0
        /// <summary>
        /// Insert the specified <paramref name="maintainable"/> to the mapping store with <paramref name="state"/>
        /// </summary>
        /// <param name="state">
        /// The MAPPING STORE connection and transaction state
        /// </param>
        /// <param name="maintainable">
        /// The maintainable.
        /// </param>
        /// <param name="artefactStoredProcedure">
        /// The artefact Stored Procedure.
        /// </param>
        /// <param name="setupCommand">
        /// The setup Command.
        /// </param>
        /// <returns>
        /// The <see cref="ArtefactImportStatus"/>.
        /// </returns>
        protected ArtefactImportStatus InsertInternal(DbTransactionState state, T maintainable, ItemSchemeProcedureBase artefactStoredProcedure, Action <DbCommand> setupCommand)
        {
            Action <DbCommand> itemSchemeSetup = command =>
            {
                artefactStoredProcedure.CreateIsPartialParameter(command).Value = maintainable.Partial ? 1 : 0;
                if (setupCommand != null)
                {
                    setupCommand(command);
                }
            };
            var artefactImportStatus = this.InsertArtefactInternal(state, maintainable, artefactStoredProcedure, itemSchemeSetup);

            var itemIds = this.ItemImportEngine.Insert(state, maintainable.Items, artefactImportStatus.PrimaryKeyValue);

            ValidationHelper.Validate(maintainable, itemIds);
            return(artefactImportStatus);
        }
Example #2
0
 /// <summary>
 /// Insert the specified <paramref name="maintainable"/> to the mapping store with <paramref name="state"/>
 /// </summary>
 /// <param name="state">
 /// The MAPPING STORE connection and transaction state
 /// </param>
 /// <param name="maintainable">
 /// The maintainable.
 /// </param>
 /// <param name="artefactStoredProcedure">
 /// The artefact Stored Procedure.
 /// </param>
 /// <returns>
 /// The <see cref="ArtefactImportStatus"/>.
 /// </returns>
 protected ArtefactImportStatus InsertInternal(DbTransactionState state, T maintainable, ItemSchemeProcedureBase artefactStoredProcedure)
 {
     return(this.InsertInternal(state, maintainable, artefactStoredProcedure, null));
 }