Class TargetItem<TEntity>
public class TargetItem<TEntity> : ITargetItem<TEntity>, ITargetItem where TEntity : Entity
Type Parameters
TEntity
- Inheritance
-
TargetItem<TEntity>
- Implements
-
ITargetItem<TEntity>
- Inherited Members
Constructors
TargetItem(Entity, Entity?, Entity?, int, int, bool)
Creates a new TargetItem instance.
public TargetItem(Entity target, Entity? preImage, Entity? postImage, int index, int count, bool isCreate)
Parameters
target
EntityThe main target of the operation
preImage
EntityThe preimage, if available
postImage
EntityThe postimage, if available
index
intThe index for the order of the records in this message
count
intThe number of records in this message
isCreate
boolWhether the operation is a create message
TargetItem(Entity, int, int, bool)
Creates a new TargetItem instance when creating outside of a plugin context.
public TargetItem(Entity target, int index, int count, bool isCreate)
Parameters
target
EntityThe main target of the operation
index
intThe index for the order of the records in this message
count
intThe number of records in this message
isCreate
boolWhether the operation is a create message
Properties
Id
Primary id of the record
public Guid Id { get; }
Property Value
Index
The index of this record within the bulk operation
public int Index { get; }
Property Value
Input
public TEntity Input { get; }
Property Value
- TEntity
this[string]
Get the expected value of the field after the operation checking data in the postimage, target, then preimage (if available). OR sets a value to the target input record.
public object? this[string attribute] { get; set; }
Parameters
attribute
stringThe logical name of the attribute.
Property Value
- object
Value of the given attribute
ItemIdentifier
Text that can be put at the front of log or error messages indicating which record is being processed.
public string ItemIdentifier { get; }
Property Value
LogicalName
The logical name of the record table
public string LogicalName { get; }
Property Value
Merged
public TEntity Merged { get; }
Property Value
- TEntity
PostImage
public TEntity? PostImage { get; }
Property Value
- TEntity
PreImage
public TEntity? PreImage { get; }
Property Value
- TEntity
Methods
CreateException(string, Exception?)
public InvalidPluginExecutionException CreateException(string message, Exception? innerException = null)
Parameters
Returns
GetValue<T>(string)
Get the expected value of the field after the operation checking data in the postimage, target, then preimage (if available).
public T? GetValue<T>(string attribute)
Parameters
attribute
stringThe logical name of the attribute to get
Returns
- T
Value of the attribute
Type Parameters
T
Type of the attribute to get
IsFieldChanged(string)
Whether the attribute has a different value between the target input and the preimage. Always returns true for create operations.
public bool IsFieldChanged(string attribute)
Parameters
attribute
stringThe logical name of the attribute to check
Returns
- bool
Whether the attribute was changed.