fix DynamicallyAccessedMembers warnings (Trimming)

This commit is contained in:
ig 2023-07-07 09:39:03 +02:00
parent b361959f53
commit 2a1e7cce93
1 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ using static System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes;
namespace InnovEnergy.Lib.Protocols.Modbus.Slaves; namespace InnovEnergy.Lib.Protocols.Modbus.Slaves;
public class ModbusDevice<R> where R : notnull public class ModbusDevice<[DynamicallyAccessedMembers(All)] R> where R : notnull
{ {
private readonly IReadOnlyList<Batch<R>> _Batches; private readonly IReadOnlyList<Batch<R>> _Batches;
@ -35,7 +35,7 @@ public class ModbusDevice<R> where R : notnull
return Read(r); return Read(r);
} }
public R Read([DynamicallyAccessedMembers(All)] R record) public R Read(R record)
{ {
foreach (var batch in _Batches) foreach (var batch in _Batches)
batch.Read(record); batch.Read(record);
@ -43,7 +43,7 @@ public class ModbusDevice<R> where R : notnull
return record; return record;
} }
public void Write([DynamicallyAccessedMembers(All)] R record) public void Write(R record)
{ {
foreach (var batch in _Batches) foreach (var batch in _Batches)
batch.Write(record); batch.Write(record);