/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Components/Analyzers/test/ComponentsTestDeclarations.cs
42 строки
1 KB
Damyan Petev
Add warning and code fix suggestion for non-public `[JSInvokable]` methods (#67137)
10 июл 2026, 11:59
Не верифицирован
10 июл 2026, 11:59
7a0af92
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace Microsoft.AspNetCore.Components.Analyzers; public static class ComponentsTestDeclarations { public static readonly string Source = $@" namespace {typeof(ParameterAttribute).Namespace} {{ public class {typeof(ParameterAttribute).Name} : System.Attribute {{ public bool CaptureUnmatchedValues {{ get; set; }} }} public class {typeof(CascadingParameterAttribute).Name} : System.Attribute {{ }} public interface {typeof(IComponent).Name} {{ }} }} "; public static readonly string SourceWithJSInvokable = """ namespace Microsoft.JSInterop { public sealed class JSInvokableAttribute : System.Attribute { public string? Identifier { get; } public JSInvokableAttribute() { } public JSInvokableAttribute(string identifier) { } } } """; }