Repository: dotnet/runtime
File: src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.ManagedNtlm.cs (C#)

Code before:
                public byte CurrentRevision;
            }

            // Type 1 message
            [StructLayout(LayoutKind.Sequential)]
            private unsafe struct NegotiateMessage
            {
                public MessageHeader Header;
                public Flags Flags;
                public MessageField DomainName;
                public MessageField WorkStation;
                public Version Version;
            }

            // TYPE 2 message
            [StructLayout(LayoutKind.Sequential)]
            private unsafe struct ChallengeMessage
            {
                public MessageHeader Header;
                public MessageField TargetName;
                public Flags Flags;
                public fixed byte ServerChallenge[ChallengeLength];
                private ulong _unused;
                public MessageField TargetInfo;
                public Version Version;
            }

            // TYPE 3 message
            [StructLayout(LayoutKind.Sequential)]
            private unsafe struct AuthenticateMessage
            {
                public MessageHeader Header;
                public MessageField LmChallengeResponse;
                public MessageField NtChallengeResponse;
                public MessageField DomainName;
                public MessageField UserName;
                public MessageField Workstation;
                public MessageField EncryptedRandomSessionKey;
                public Flags Flags;
                public Version Version;
                public fixed byte Mic[16];
            }

            // Set temp to ConcatenationOf(Responserversion, HiResponserversion, Z(6), Time, ClientChallenge, Z(4), ServerName, Z(4))
            [StructLayout(LayoutKind.Sequential)]
            private unsafe struct NtChallengeResponse
            {
                public fixed byte Hmac[DigestLength];
                public byte Responserversion;
                public byte HiResponserversion;
                private byte _reserved1;

Review comment (suggestion):
```suggestion
                    readonly get => BitConverter.IsLittleEndian? _flags: (Flags)BinaryPrimitives.ReverseEndianness((uint)_flags);
                    set => _flags = BitConverter.IsLittleEndian? value: (Flags)BinaryPrimitives.ReverseEndianness((uint)value);
```

Code after:
                public byte VersionMinor;
                private ushort _productBuild;
                private byte _unused4;
                private byte _unused5;
                private byte _unused6;
                public byte CurrentRevision;
                public ushort ProductBuild
                {
                    readonly get =>BitConverter.IsLittleEndian? _productBuild: BinaryPrimitives.ReverseEndianness(_productBuild);
                    set =>_productBuild = BitConverter.IsLittleEndian? value: BinaryPrimitives.ReverseEndianness(value);
                }
            }

            // Type 1 message
            [StructLayout(LayoutKind.Sequential)]
            private unsafe struct NegotiateMessage
            {
                public MessageHeader Header;
                private Flags _flags;
                public MessageField DomainName;
                public MessageField WorkStation;
                public Version Version;
                public Flags Flags
                {
                    readonly get =>BitConverter.IsLittleEndian? _flags: (Flags)BinaryPrimitives.ReverseEndianness((uint)_flags);
                    set =>_flags = BitConverter.IsLittleEndian? value: (Flags)BinaryPrimitives.ReverseEndianness((uint)value);
                }
            }

            // TYPE 2 message
            [StructLayout(LayoutKind.Sequential)]
            private unsafe struct ChallengeMessage
            {
                public MessageHeader Header;
                public MessageField TargetName;
                public Flags Flags;
                public fixed byte ServerChallenge[ChallengeLength];
                private ulong _unused;
                public MessageField TargetInfo;
                public Version Version;
            }

            // TYPE 3 message
            [StructLayout(LayoutKind.Sequential)]
            private unsafe struct AuthenticateMessage
            {
                public MessageHeader Header;
                public MessageField LmChallengeResponse;
                public MessageField NtChallengeResponse;
                public MessageField DomainName;
                public MessageField UserName;