@@ -29,14 +29,15 @@ namespace Grpc.Core;
2929public class AuthProperty
3030{
3131 static readonly Encoding EncodingUTF8 = System . Text . Encoding . UTF8 ;
32- string name ;
33- byte [ ] valueBytes ;
34- string ? lazyValue ;
32+
33+ private readonly string name ;
34+ private readonly byte [ ] valueBytes ;
35+ private string ? lazyValue ;
3536
3637 private AuthProperty ( string name , byte [ ] valueBytes )
3738 {
38- this . name = GrpcPreconditions . CheckNotNull ( name ) ;
39- this . valueBytes = GrpcPreconditions . CheckNotNull ( valueBytes ) ;
39+ this . name = GrpcPreconditions . CheckNotNull ( name , nameof ( name ) ) ;
40+ this . valueBytes = GrpcPreconditions . CheckNotNull ( valueBytes , nameof ( valueBytes ) ) ;
4041 }
4142
4243 /// <summary>
@@ -57,7 +58,7 @@ public string Value
5758 {
5859 get
5960 {
60- return lazyValue ?? ( lazyValue = EncodingUTF8 . GetString ( this . valueBytes ) ) ;
61+ return lazyValue ??= EncodingUTF8 . GetString ( this . valueBytes ) ;
6162 }
6263 }
6364
@@ -81,7 +82,7 @@ public byte[] ValueBytes
8182 /// <param name="valueBytes">the binary value of the property</param>
8283 public static AuthProperty Create ( string name , byte [ ] valueBytes )
8384 {
84- GrpcPreconditions . CheckNotNull ( valueBytes ) ;
85+ GrpcPreconditions . CheckNotNull ( valueBytes , nameof ( valueBytes ) ) ;
8586 var valueCopy = new byte [ valueBytes . Length ] ;
8687 Buffer . BlockCopy ( valueBytes , 0 , valueCopy , 0 , valueBytes . Length ) ;
8788 return new AuthProperty ( name , valueCopy ) ;
0 commit comments