From 2a1e7cce93963e8f4309f60322c96b4d85ee3119 Mon Sep 17 00:00:00 2001 From: ig Date: Fri, 7 Jul 2023 09:39:03 +0200 Subject: [PATCH] fix DynamicallyAccessedMembers warnings (Trimming) --- csharp/Lib/Protocols/Modbus/Slaves/ModbusDevice.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csharp/Lib/Protocols/Modbus/Slaves/ModbusDevice.cs b/csharp/Lib/Protocols/Modbus/Slaves/ModbusDevice.cs index 8f0acf770..e04c4bef7 100644 --- a/csharp/Lib/Protocols/Modbus/Slaves/ModbusDevice.cs +++ b/csharp/Lib/Protocols/Modbus/Slaves/ModbusDevice.cs @@ -5,7 +5,7 @@ using static System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes; namespace InnovEnergy.Lib.Protocols.Modbus.Slaves; -public class ModbusDevice where R : notnull +public class ModbusDevice<[DynamicallyAccessedMembers(All)] R> where R : notnull { private readonly IReadOnlyList> _Batches; @@ -35,7 +35,7 @@ public class ModbusDevice where R : notnull return Read(r); } - public R Read([DynamicallyAccessedMembers(All)] R record) + public R Read(R record) { foreach (var batch in _Batches) batch.Read(record); @@ -43,7 +43,7 @@ public class ModbusDevice where R : notnull return record; } - public void Write([DynamicallyAccessedMembers(All)] R record) + public void Write(R record) { foreach (var batch in _Batches) batch.Write(record);