Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
using System.Data;
|
||||
using JdeScoping.DataSync.Generated;
|
||||
|
||||
namespace JdeScoping.DataSync.IntegrationTests.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// IDataReader implementation for BulkMergeTestEntity.
|
||||
/// </summary>
|
||||
public sealed class BulkMergeTestEntityDataReader : AsyncEnumerableDataReader<BulkMergeTestEntity>
|
||||
{
|
||||
private static readonly string[] _columnNames = ["Id", "Name", "Amount", "LastUpdateDt"];
|
||||
private static readonly Type[] _columnTypes = [typeof(int), typeof(string), typeof(decimal), typeof(DateTime)];
|
||||
|
||||
public BulkMergeTestEntityDataReader(IAsyncEnumerable<BulkMergeTestEntity> source) : base(source) { }
|
||||
|
||||
protected override string[] ColumnNames => _columnNames;
|
||||
|
||||
public static IReadOnlyList<string> GetColumnNames() => _columnNames;
|
||||
|
||||
protected override object GetColumnValue(int ordinal)
|
||||
{
|
||||
var entity = Current!;
|
||||
return ordinal switch
|
||||
{
|
||||
0 => entity.Id,
|
||||
1 => entity.Name,
|
||||
2 => entity.Amount ?? (object)DBNull.Value,
|
||||
3 => entity.LastUpdateDt,
|
||||
_ => throw new IndexOutOfRangeException()
|
||||
};
|
||||
}
|
||||
|
||||
protected override Type GetColumnType(int ordinal) => _columnTypes[ordinal];
|
||||
}
|
||||
Reference in New Issue
Block a user