BusinessProcessAdvancedSettingsSuppressValueBindingInInsertActivity Property
Gets or sets the value determining if initial value binding is suppressed when the
BusinessProcessActivity property is set to Insert.
Namespace: Firefly.BoxAssembly: Firefly.Box (in Firefly.Box.dll) Version: debug-master-v:33791
public bool SuppressValueBindingInInsertActivity { get; set; }
Public Property SuppressValueBindingInInsertActivity As Boolean
Get
Set
member SuppressValueBindingInInsertActivity : bool with get, set
Property Value
Boolean This property doesn't affect reevaluation
SupressValueBinding
This example is in the form of Unit Tests. It references the NUnit framework. This framework can be downloaded from
www.NUnit.org. For more information about unit testing visit:
www.NUnit.org.
This example is based on test data. The code for the entities included in this test data can be found in the documentation of
Entityusing System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using Firefly.Box;
using Firefly.Box.Testing;
namespace TestFirefly.Box.Documentation
{
[TestFixture]
public class SupressValueBindingDemo
{
[Test]
public void Supressed()
{
var jobs = new Pubs.Jobs();
jobs.Truncate();
var bp =
new BusinessProcess(
new BusinessProcess.AdvancedSettings
{
SuppressValueBindingInInsertActivity = true
})
{
From = jobs,
Activity = Activities.Insert
};
bp.AddAllColumns();
jobs.Id.BindValue(() => 1);
bp.ForFirstRow(() => jobs.Id.ShouldBe(0));//Because the bind value is supressed, the id is 0
}
[Test]
public void NotSupressed()
{
var jobs = new Pubs.Jobs();
jobs.Truncate();
var bp =
new BusinessProcess(
new BusinessProcess.AdvancedSettings
{
SuppressValueBindingInInsertActivity = false
})
{
From = jobs,
Activity = Activities.Insert
};
bp.AddAllColumns();
jobs.Id.BindValue(() => 1);
bp.ForFirstRow(() => jobs.Id.ShouldBe(1));//Because the bind value is not supressed,
// it is evaluated, and the value is 1;
}
}
}