Skip to content

Commit 014e37c

Browse files
committed
Move helper types to separate file
1 parent 8d194d1 commit 014e37c

File tree

3 files changed

+42
-29
lines changed

3 files changed

+42
-29
lines changed

src/Http/Http.Extensions/gen/StaticRouteHandlerModel/EndpointParameter.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -586,32 +586,3 @@ public override int GetHashCode()
586586
return hashCode.ToHashCode();
587587
}
588588
}
589-
590-
internal sealed class ParameterLookupKey
591-
{
592-
public ParameterLookupKey(string name, ITypeSymbol type)
593-
{
594-
Name = name;
595-
Type = type;
596-
}
597-
598-
public string Name { get; }
599-
public ITypeSymbol Type { get; }
600-
601-
public override int GetHashCode()
602-
{
603-
return StringComparer.OrdinalIgnoreCase.GetHashCode(Name);
604-
}
605-
606-
public override bool Equals([NotNullWhen(true)] object? obj)
607-
{
608-
if (obj is ParameterLookupKey other)
609-
{
610-
return SymbolEqualityComparer.Default.Equals(Type, other.Type) &&
611-
string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase);
612-
}
613-
return false;
614-
}
615-
}
616-
617-
internal record ConstructorParameter(IPropertySymbol Property, IParameterSymbol? Parameter);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
using Microsoft.CodeAnalysis;
4+
5+
namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandlerModel;
6+
7+
internal record ConstructorParameter(IPropertySymbol Property, IParameterSymbol? Parameter);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using System.Diagnostics.CodeAnalysis;
6+
using Microsoft.CodeAnalysis;
7+
8+
namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandlerModel;
9+
10+
internal sealed class ParameterLookupKey
11+
{
12+
public ParameterLookupKey(string name, ITypeSymbol type)
13+
{
14+
Name = name;
15+
Type = type;
16+
}
17+
18+
public string Name { get; }
19+
public ITypeSymbol Type { get; }
20+
21+
public override int GetHashCode()
22+
{
23+
return StringComparer.OrdinalIgnoreCase.GetHashCode(Name);
24+
}
25+
26+
public override bool Equals([NotNullWhen(true)] object? obj)
27+
{
28+
if (obj is ParameterLookupKey other)
29+
{
30+
return SymbolEqualityComparer.Default.Equals(Type, other.Type) &&
31+
string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase);
32+
}
33+
return false;
34+
}
35+
}

0 commit comments

Comments
 (0)