コード例 #1
0
        /// <summary>
        ///     Executes a request to insert several values in a table.
        ///     This is the synchronous implementation.
        /// </summary>
        /// <parameters>
        /// <param name="context">Description of the request.</param>
        /// </parameters>
        /// <returns>
        ///     The request result.
        /// </returns>
        protected virtual IInsertResult Execute(IInsertContext context)
        {
            if (!IsOperationThreadStarted)
            {
                return(new InsertResult(false, ResultError.ErrorFatalNoOperationThread));
            }

            if (context.RowCount == 0 || context.EntryList.Count == 0)
            {
                return(new InsertResult(true, ResultError.ErrorNone));
            }

            IActiveOperation <IInsertResultInternal> ActiveOperation = Connector.Insert(context);
            IInsertResultInternal Result = ActiveOperation.Result;

            FinalizeOrQueue(ActiveOperation);

            return(Result);
        }
コード例 #2
0
 /// <summary>
 /// Insert data into repository.
 /// </summary>
 /// <param name="data">Generic object.</param>
 public virtual void Insert(T data)
 {
     Connector.Insert(data);
 }