protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Bulk Operation Options | Entity Framework Extensions Library";

            // Auditing
            {
                uiUseAudit.ServerClick += (o, args) =>
                {
                    var auditEntries = BulkMethodsHelper.UseAudit(NbRecords, SbOperation);

                    AppendEntries(auditEntries);
                    uiOutput.InnerText = SbOperation.ToString();

                    ShowSourceCode(@"BulkOperationOptionsHelper\UseAudit.cs");
                };
            }

            // Logging
            {
                uiLog.ServerClick += (o, args) =>
                {
                    BulkMethodsHelper.Log(NbRecords, SbOperation);

                    uiOutput.InnerText = SbOperation.ToString();

                    ShowSourceCode(@"BulkOperationOptionsHelper\Log.cs");
                };

                uiUseLogDump.ServerClick += (o, args) =>
                {
                    BulkMethodsHelper.UseLogDump(NbRecords, SbOperation);

                    uiOutput.InnerText = SbOperation.ToString();

                    ShowSourceCode(@"BulkOperationOptionsHelper\UseLogDump.cs");
                };
            }

            // Transient Error Handling
            {
                uiRetryCount.ServerClick += (o, args) =>
                {
                    BulkMethodsHelper.RetryCount(NbRecords, SbOperation);

                    uiOutput.InnerText = SbOperation.ToString();

                    ShowSourceCode(@"BulkOperationOptionsHelper\RetryCount.cs");
                };

                uiRetryInterval.ServerClick += (o, args) =>
                {
                    BulkMethodsHelper.RetryInterval(NbRecords, SbOperation);

                    uiOutput.InnerText = SbOperation.ToString();

                    ShowSourceCode(@"BulkOperationOptionsHelper\RetryInterval.cs");
                };
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Bulk Methods Benchmarks | Entity Framework Extensions Library";

            if (!Page.IsPostBack)
            {
                uiNbRecords.Value        = MaxNbRecordsSaveChanges.ToString();
                uiNbRecordsError.Visible = false;
            }

            // Entity Framework Extensions - Bulk Operations
            {
                uiBulkInsert.ServerClick += (o, args) =>
                {
                    if (!IsValid(MaxNbRecords))
                    {
                        return;
                    }

                    PreAction();
                    BulkMethodsHelper.BulkInsert(NbRecords, Clock, SbOperation);
                    PostAction();

                    ShowSourceCode(@"BulkMethodsHelper\BulkInsert.cs");
                };

                uiBulkUpdate.ServerClick += (o, args) =>
                {
                    if (!IsValid(MaxNbRecords))
                    {
                        return;
                    }

                    PreAction();
                    BulkMethodsHelper.BulkUpdate(NbRecords, Clock, SbOperation);
                    PostAction();

                    ShowSourceCode(@"BulkMethodsHelper\BulkUpdate.cs");
                };

                uiBulkDelete.ServerClick += (o, args) =>
                {
                    if (!IsValid(MaxNbRecords))
                    {
                        return;
                    }

                    PreAction();
                    BulkMethodsHelper.BulkDelete(NbRecords, Clock, SbOperation);
                    PostAction();

                    ShowSourceCode(@"BulkMethodsHelper\BulkDelete.cs");
                };

                uiBulkMerge.ServerClick += (o, args) =>
                {
                    if (!IsValid(MaxNbRecords))
                    {
                        return;
                    }

                    PreAction();
                    BulkMethodsHelper.BulkMerge(NbRecords, Clock, SbOperation);
                    PostAction();

                    ShowSourceCode(@"BulkMethodsHelper\BulkMerge.cs");
                };
            }

            // SaveChanges (Entity Framework)
            {
                uiSaveChangesInsert.ServerClick += (o, args) =>
                {
                    if (!IsValid(MaxNbRecordsSaveChanges))
                    {
                        return;
                    }

                    PreAction();
                    BulkMethodsHelper.SaveChangesInsert(NbRecords, Clock, SbOperation);
                    PostAction();

                    ShowSourceCode(@"BulkMethodsHelper\SaveChangesInsert.cs");
                };

                uiSaveChangesUpdate.ServerClick += (o, args) =>
                {
                    if (!IsValid(MaxNbRecordsSaveChanges))
                    {
                        return;
                    }

                    PreAction();
                    BulkMethodsHelper.SaveChangesUpdate(NbRecords, Clock, SbOperation);
                    PostAction();

                    ShowSourceCode(@"BulkMethodsHelper\SaveChangesUpdate.cs");
                };

                uiSaveChangesDelete.ServerClick += (o, args) =>
                {
                    if (!IsValid(MaxNbRecordsSaveChanges))
                    {
                        return;
                    }

                    PreAction();
                    BulkMethodsHelper.SaveChangesDelete(NbRecords, Clock, SbOperation);
                    PostAction();

                    ShowSourceCode(@"BulkMethodsHelper\SaveChangesDelete.cs");
                };
            }
        }