src/Microsoft/JSInterop/Dynamic/0.Core/src/Component/Assigners/JSDynamicModuleActivatingAssigner.cs
/// <summary>
/// Assigns component property with returning non-null JavaScript module facade.
/// </summary>
/// <returns>null/default or the JavaScript module facade.</returns>
Assigns component property with returning non-null JavaScript module facade.
Assigns component property with returning non - null JavaScript module facade .
public virtual async ValueTask AssignValueAsync(IMemberDefinition definition, ValueAssignerContext context)
        {
            if (!JSModuleAttributeUtils.TryGetModuleNameOrPath<ActivateDynamicModuleAttribute, JSModuleAttribute>(
                definition,
                out var propertyAttribute,
                out var moduleNameOrPath)) {
                return;
            }
            var interfaceToBeProxied = propertyAttribute.InterfaceToBeProxied ?? definition.MemberType;
            var jsFacade = await jsDynamicModuleActivator.CreateInstanceAsync(interfaceToBeProxied, moduleNameOrPath);
            context.SetValueResult(jsFacade);
        }
public virtual async ValueTask AssignValueAsync ( IMemberDefinition definition , ValueAssignerContext context ) { if ( ! JSModuleAttributeUtils . TryGetModuleNameOrPath < ActivateDynamicModuleAttribute , JSModuleAttribute > ( definition , out var propertyAttribute , out var moduleNameOrPath ) ) { return ; } var interfaceToBeProxied = propertyAttribute . InterfaceToBeProxied ?? definition . MemberType ; var jsFacade = await jsDynamicModuleActivator . CreateInstanceAsync ( interfaceToBeProxied , moduleNameOrPath ) ; context . SetValueResult ( jsFacade ) ; }
Assigns component property with returning non-null JavaScript module facade.
Assigns component property with returning non - null JavaScript module facade .
null/default or the JavaScript module facade.
null / default or the JavaScript module facade .
definition
IMemberDefinition
context
ValueAssignerContext