LPDHelpers..::..CopyRecords Method (IEnumerable<(Of <(<'ARecord>)>)>, ANamespaceAccess, String, Func<(Of <(<'ARecord, dynamic>)>)>, WritePolicy, ParallelOptions)
Copies ARecord's from the source to targetSetName in targetNamespace.
Note that if the namespace and/or set is different, this instances's values are used, except
in the case where the primary key is a digest. In these cases, an InvalidOperationException is thrown but the PK can be changed with newPrimaryKeyValue
Namespace:
Aerospike.ClientAssembly: Aerospike.Database.LINQPadDriver (in Aerospike.Database.LINQPadDriver.dll)
Syntax
public static SetRecords CopyRecords( IEnumerable<ARecord> source, ANamespaceAccess targetNamespace, string targetSetName, Func<ARecord, dynamic> newPrimaryKeyValue, WritePolicy writePolity, ParallelOptions parallelOptions )
Parameters
- source
- Type: IEnumerable<(Of <(<'ARecord>)>)>
The collection of records that will be copied
- targetNamespace
- Type: Aerospike.Database.LINQPadDriver.Extensions..::..ANamespaceAccess
The Namespace that will be the target of the record copy.
- targetSetName
- Type: String
The targeted Set where the records will be copied too. This can be a new set within the namespace. This can be null, in which case the records are copied to the 'null' set.
- newPrimaryKeyValue
- Type: Func<(Of <(<'ARecord, dynamic>)>)>
Each record is passed as the first argument, and the return is the new primary key for that record. Note: it is possible to change any of the record's bin values via the [ARecord.SetValue(string, object, bool)] method, but this would change the original record.
- writePolity
- Type: WritePolicy
The Aerospike Write Policy.
- parallelOptions
- Type: ParallelOptions
The ParallelOptions used to perform the copy operation.
Return Value
Returns the Set instance that was the target set or null to indicated that a [ANamespaceAccess.RefreshExplorer] is required.Exceptions
Exception | Condition |
---|---|
InvalidOperationException | If the record's primary key is a digest (not an actual value). This exception will be thrown, since a digest has the namespace and set of where this record was retrieved from. |
See Also
[T:Aerospike.Database.LINQPadDriver.Extensions.SetRecords`1.CopyRecords``1(Aerospike.Database.LINQPadDriver.Extensions.SetRecords{``0},System.Func{`0,dynamic},Aerospike.Client.WritePolicy,System.Threading.Tasks.ParallelOptions)]
[T:Aerospike.Database.LINQPadDriver.Extensions.SetRecords`1.CopyRecords``1(Aerospike.Database.LINQPadDriver.Extensions.SetRecords{``0},System.Func{`0,dynamic},Aerospike.Client.WritePolicy,System.Threading.Tasks.ParallelOptions)]
[T:Aerospike.Database.LINQPadDriver.Extensions.SetRecords`1.CopyRecords``1(Aerospike.Database.LINQPadDriver.Extensions.SetRecords{``0},System.Func{`0,dynamic},Aerospike.Client.WritePolicy,System.Threading.Tasks.ParallelOptions)]