From 512c38a5bdfbf0e4c522069daa20f8d8dbb22a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 21 Sep 2022 15:54:08 +0100 Subject: [PATCH] Add backing fields for PinValuePair properties (#59) --- System.Device.Gpio/PinValuePair.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/System.Device.Gpio/PinValuePair.cs b/System.Device.Gpio/PinValuePair.cs index 36dec2d..a20e9f9 100644 --- a/System.Device.Gpio/PinValuePair.cs +++ b/System.Device.Gpio/PinValuePair.cs @@ -9,15 +9,17 @@ namespace System.Device.Gpio /// public readonly struct PinValuePair { + private readonly int _pinNumber; + private readonly PinValue _pinValue; + /// /// The pin number. /// - public int PinNumber { get; } - + public int PinNumber => _pinNumber; /// /// The pin value. /// - public PinValue PinValue { get; } + public PinValue PinValue => _pinValue; /// /// Initializes a new instance of the struct. @@ -26,8 +28,8 @@ public readonly struct PinValuePair /// The pin value. public PinValuePair(int pinNumber, PinValue pinValue) { - PinNumber = pinNumber; - PinValue = pinValue; + _pinNumber = pinNumber; + _pinValue = pinValue; } ///