-
-
Notifications
You must be signed in to change notification settings - Fork 782
Expand file tree
/
Copy pathRefitMetadata.cs
More file actions
22 lines (17 loc) · 727 Bytes
/
RefitMetadata.cs
File metadata and controls
22 lines (17 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System.Linq;
using Microsoft.CodeAnalysis;
namespace Refit.Generator;
internal class RefitMetadata
{
public RefitMetadata(INamedTypeSymbol? disposableInterfaceSymbol, INamedTypeSymbol httpMethodBaseAttributeSymbol)
{
DisposableInterfaceSymbol = disposableInterfaceSymbol;
HttpMethodBaseAttributeSymbol = httpMethodBaseAttributeSymbol;
}
public INamedTypeSymbol? DisposableInterfaceSymbol { get; }
public INamedTypeSymbol HttpMethodBaseAttributeSymbol { get; }
public bool IsRefitMethod(IMethodSymbol? methodSymbol)
{
return methodSymbol?.GetAttributes().Any(ad => ad.AttributeClass?.InheritsFromOrEquals(HttpMethodBaseAttributeSymbol) == true) == true;
}
}