Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,53 @@ public static object ControlT10(IExecuteReader command)

public static object ControlHookedT10(IExecuteReader command)
=> command.Map(HookedT10).ToList();

// The A/A control (CtlH_T2): CtlH_T's readers again, textually the same, compiled as methods of their own.
static readonly Func<System.Data.Common.DbDataReader, GenRowT20> ReadT20DbCopy = static r => new()
{
Id = r.GetInt32(0),
Created = r.GetDateTime(1),
Title = r.GetString(2),
Price = r.GetDecimal(3),
Qty = r.IsDBNull(4) ? null : r.GetInt32(4),
IsActive = r.GetBoolean(5),
Key = r.GetGuid(6),
Score = r.GetDouble(7),
Note = r.IsDBNull(8) ? null : r.GetString(8),
Blob = (byte[])r.GetValue(9),
Big = r.GetInt64(10),
Body = r.GetString(11),
Amount = r.IsDBNull(12) ? null : r.GetDecimal(12),
Stamp = r.IsDBNull(13) ? null : r.GetDateTime(13),
Tag = r.GetString(14),
Ratio = r.GetDouble(15),
Flag = r.IsDBNull(16) ? null : r.GetBoolean(16),
Link = r.IsDBNull(17) ? null : r.GetGuid(17),
Count = r.GetInt64(18),
Summary = r.IsDBNull(19) ? null : r.GetString(19),
};

static readonly RowMap<GenRowT20> HookedCopyT20 = Generation.GeneratedRowMap.Create<GenRowT20>(static _ => ReadT20DbCopy);

public static object ControlHookedCopyT20(IExecuteReader command)
=> command.Map(HookedCopyT20).ToList();

static readonly Func<System.Data.Common.DbDataReader, GenRowT10> ReadT10DbCopy = static r => new()
{
Id = r.GetInt32(0),
Created = r.GetDateTime(1),
Title = r.GetString(2),
Price = r.GetDecimal(3),
Qty = r.IsDBNull(4) ? null : r.GetInt32(4),
IsActive = r.GetBoolean(5),
Key = r.GetGuid(6),
Score = r.GetDouble(7),
Note = r.IsDBNull(8) ? null : r.GetString(8),
Blob = (byte[])r.GetValue(9),
};

static readonly RowMap<GenRowT10> HookedCopyT10 = Generation.GeneratedRowMap.Create<GenRowT10>(static _ => ReadT10DbCopy);

public static object ControlHookedCopyT10(IExecuteReader command)
=> command.Map(HookedCopyT10).ToList();
}
Loading