Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use auto properties and misc code cleanup #398

Merged
merged 11 commits into from
Oct 20, 2024
31 changes: 4 additions & 27 deletions src/GraphQLParser/AST/Definitions/GraphQLArgumentsDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,17 @@ public GraphQLArgumentsDefinition(List<GraphQLInputValueDefinition> items)

internal sealed class GraphQLArgumentsDefinitionWithLocation : GraphQLArgumentsDefinition
{
private GraphQLLocation _location;

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}
public override GraphQLLocation Location { get; set; }
}

internal sealed class GraphQLArgumentsDefinitionWithComment : GraphQLArgumentsDefinition
{
private List<GraphQLComment>? _comments;

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}

internal sealed class GraphQLArgumentsDefinitionFull : GraphQLArgumentsDefinition
{
private GraphQLLocation _location;
private List<GraphQLComment>? _comments;
public override GraphQLLocation Location { get; set; }

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
31 changes: 4 additions & 27 deletions src/GraphQLParser/AST/Definitions/GraphQLDirectiveDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,40 +48,17 @@ public GraphQLDirectiveDefinition(GraphQLName name, GraphQLDirectiveLocations lo

internal sealed class GraphQLDirectiveDefinitionWithLocation : GraphQLDirectiveDefinition
{
private GraphQLLocation _location;

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}
public override GraphQLLocation Location { get; set; }
}

internal sealed class GraphQLDirectiveDefinitionWithComment : GraphQLDirectiveDefinition
{
private List<GraphQLComment>? _comments;

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}

internal sealed class GraphQLDirectiveDefinitionFull : GraphQLDirectiveDefinition
{
private GraphQLLocation _location;
private List<GraphQLComment>? _comments;
public override GraphQLLocation Location { get; set; }

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
31 changes: 4 additions & 27 deletions src/GraphQLParser/AST/Definitions/GraphQLEnumTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,17 @@ public GraphQLEnumTypeDefinition(GraphQLName name)

internal sealed class GraphQLEnumTypeDefinitionWithLocation : GraphQLEnumTypeDefinition
{
private GraphQLLocation _location;

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}
public override GraphQLLocation Location { get; set; }
}

internal sealed class GraphQLEnumTypeDefinitionWithComment : GraphQLEnumTypeDefinition
{
private List<GraphQLComment>? _comments;

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}

internal sealed class GraphQLEnumTypeDefinitionFull : GraphQLEnumTypeDefinition
{
private GraphQLLocation _location;
private List<GraphQLComment>? _comments;
public override GraphQLLocation Location { get; set; }

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
31 changes: 4 additions & 27 deletions src/GraphQLParser/AST/Definitions/GraphQLEnumValueDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,17 @@ public GraphQLEnumValueDefinition(GraphQLName name, GraphQLEnumValue enumValue)

internal sealed class GraphQLEnumValueDefinitionWithLocation : GraphQLEnumValueDefinition
{
private GraphQLLocation _location;

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}
public override GraphQLLocation Location { get; set; }
}

internal sealed class GraphQLEnumValueDefinitionWithComment : GraphQLEnumValueDefinition
{
private List<GraphQLComment>? _comments;

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}

internal sealed class GraphQLEnumValueDefinitionFull : GraphQLEnumValueDefinition
{
private GraphQLLocation _location;
private List<GraphQLComment>? _comments;
public override GraphQLLocation Location { get; set; }

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
31 changes: 4 additions & 27 deletions src/GraphQLParser/AST/Definitions/GraphQLEnumValuesDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,17 @@ public GraphQLEnumValuesDefinition(List<GraphQLEnumValueDefinition> items)

internal sealed class GraphQLEnumValuesDefinitionWithLocation : GraphQLEnumValuesDefinition
{
private GraphQLLocation _location;

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}
public override GraphQLLocation Location { get; set; }
}

internal sealed class GraphQLEnumValuesDefinitionWithComment : GraphQLEnumValuesDefinition
{
private List<GraphQLComment>? _comments;

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}

internal sealed class GraphQLEnumValuesDefinitionFull : GraphQLEnumValuesDefinition
{
private GraphQLLocation _location;
private List<GraphQLComment>? _comments;
public override GraphQLLocation Location { get; set; }

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
31 changes: 4 additions & 27 deletions src/GraphQLParser/AST/Definitions/GraphQLFieldDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,17 @@ public GraphQLFieldDefinition(GraphQLName name, GraphQLType type)

internal sealed class GraphQLFieldDefinitionWithLocation : GraphQLFieldDefinition
{
private GraphQLLocation _location;

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}
public override GraphQLLocation Location { get; set; }
}

internal sealed class GraphQLFieldDefinitionWithComment : GraphQLFieldDefinition
{
private List<GraphQLComment>? _comments;

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}

internal sealed class GraphQLFieldDefinitionFull : GraphQLFieldDefinition
{
private GraphQLLocation _location;
private List<GraphQLComment>? _comments;
public override GraphQLLocation Location { get; set; }

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
31 changes: 4 additions & 27 deletions src/GraphQLParser/AST/Definitions/GraphQLFieldsDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,17 @@ public GraphQLFieldsDefinition(List<GraphQLFieldDefinition> items)

internal sealed class GraphQLFieldsDefinitionWithLocation : GraphQLFieldsDefinition
{
private GraphQLLocation _location;

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}
public override GraphQLLocation Location { get; set; }
}

internal sealed class GraphQLFieldsDefinitionWithComment : GraphQLFieldsDefinition
{
private List<GraphQLComment>? _comments;

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}

internal sealed class GraphQLFieldsDefinitionFull : GraphQLFieldsDefinition
{
private GraphQLLocation _location;
private List<GraphQLComment>? _comments;
public override GraphQLLocation Location { get; set; }

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
31 changes: 4 additions & 27 deletions src/GraphQLParser/AST/Definitions/GraphQLFragmentDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,16 @@ public GraphQLFragmentDefinition(GraphQLFragmentName name, GraphQLTypeCondition

internal sealed class GraphQLFragmentDefinitionWithLocation : GraphQLFragmentDefinition
{
private GraphQLLocation _location;

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}
public override GraphQLLocation Location { get; set; }
}

internal sealed class GraphQLFragmentDefinitionWithComment : GraphQLFragmentDefinition
{
private List<GraphQLComment>? _comments;

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
internal sealed class GraphQLFragmentDefinitionFull : GraphQLFragmentDefinition
{
private GraphQLLocation _location;
private List<GraphQLComment>? _comments;
public override GraphQLLocation Location { get; set; }

public override GraphQLLocation Location
{
get => _location;
set => _location = value;
}

public override List<GraphQLComment>? Comments
{
get => _comments;
set => _comments = value;
}
public override List<GraphQLComment>? Comments { get; set; }
}
Loading
Loading