/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Shared/Components/ComponentParameter.cs
33 строки
1 KB
Steve Sanderson
Razor Component endpoint implementation (#47117)
10 мар 2023, 18:50
Не верифицирован
10 мар 2023, 18:50
6f0e422
Код
Авторство
О чём код?
// 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; #nullable enable // This is shared-source with Mvc.ViewFeatures which does not enable nullability by default internal struct ComponentParameter { public string Name { get; set; } public string? TypeName { get; set; } public string? Assembly { get; set; } public static (IList<ComponentParameter> parameterDefinitions, IList<object?> parameterValues) FromParameterView(ParameterView parameters) { var parameterDefinitions = new List<ComponentParameter>(); var parameterValues = new List<object?>(); foreach (var kvp in parameters) { var valueType = kvp.Value?.GetType(); parameterDefinitions.Add(new ComponentParameter { Name = kvp.Name, TypeName = valueType?.FullName, Assembly = valueType?.Assembly?.GetName()?.Name }); parameterValues.Add(kvp.Value); } return (parameterDefinitions, parameterValues); } }