Skip to content

Commit a8f0eac

Browse files
Convert a couple of properties to auto-properties
The following properties are now defined as read-only auto-properties: - `BoundAttributeParameterDescriptor.DocumentationObject` - `BoundAttributeParameterDescriptor.TypeNameObject`
1 parent 3e98e1b commit a8f0eac

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/BoundAttributeParameterDescriptor.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,26 @@ namespace Microsoft.AspNetCore.Razor.Language;
1010
public sealed class BoundAttributeParameterDescriptor : TagHelperObject<BoundAttributeParameterDescriptor>
1111
{
1212
private readonly BoundAttributeParameterFlags _flags;
13-
private readonly DocumentationObject _documentationObject;
14-
private readonly TypeNameObject _typeNameObject;
15-
1613
private BoundAttributeDescriptor? _parent;
1714
private string? _displayName;
1815

1916
public BoundAttributeParameterFlags Flags => _flags;
2017
public string Name { get; }
2118
public string PropertyName { get; }
22-
public string TypeName => _typeNameObject.GetTypeName().AssumeNotNull();
19+
public string TypeName => TypeNameObject.GetTypeName().AssumeNotNull();
2320
public string DisplayName => _displayName ??= ":" + Name;
2421

25-
public string? Documentation => _documentationObject.GetText();
22+
public string? Documentation => DocumentationObject.GetText();
23+
24+
internal TypeNameObject TypeNameObject { get; }
25+
internal DocumentationObject DocumentationObject { get; }
2626

2727
public bool CaseSensitive => _flags.IsFlagSet(BoundAttributeParameterFlags.CaseSensitive);
2828
public bool IsEnum => _flags.IsFlagSet(BoundAttributeParameterFlags.IsEnum);
29-
public bool IsStringProperty => _typeNameObject.IsString;
30-
public bool IsBooleanProperty => _typeNameObject.IsBoolean;
29+
public bool IsStringProperty => TypeNameObject.IsString;
30+
public bool IsBooleanProperty => TypeNameObject.IsBoolean;
3131
public bool BindAttributeGetSet => _flags.IsFlagSet(BoundAttributeParameterFlags.BindAttributeGetSet);
3232

33-
internal TypeNameObject TypeNameObject => _typeNameObject;
34-
internal DocumentationObject DocumentationObject => _documentationObject;
35-
3633
internal BoundAttributeParameterDescriptor(
3734
BoundAttributeParameterFlags flags,
3835
string name,
@@ -46,13 +43,13 @@ internal BoundAttributeParameterDescriptor(
4643

4744
Name = name;
4845
PropertyName = propertyName;
49-
_typeNameObject = typeNameObject;
50-
_documentationObject = documentationObject;
46+
TypeNameObject = typeNameObject;
47+
DocumentationObject = documentationObject;
5148
}
5249

5350
private protected override void BuildChecksum(in Checksum.Builder builder)
5451
{
55-
builder.AppendData((byte)Flags);
52+
builder.AppendData((byte)_flags);
5653
builder.AppendData(Name);
5754
builder.AppendData(PropertyName);
5855

0 commit comments

Comments
 (0)