private Func<DisplayContext, IHtmlString> CreateDelegate(
            ShapeAttributeOccurrence attributeOccurrence,
            ShapeDescriptor descriptor) {
            return context => {
                var serviceInstance = _componentContext.Resolve(attributeOccurrence.Registration, Enumerable.Empty<Parameter>());

                // oversimplification for the sake of evolving
                return PerformInvoke(context, attributeOccurrence.MethodInfo, serviceInstance);
            };
        }
コード例 #2
0
        private Func <DisplayContext, IHtmlString> CreateDelegate(
            ShapeAttributeOccurrence attributeOccurrence,
            ShapeDescriptor descriptor)
        {
            return(context => {
                var serviceInstance = _componentContext.ResolveComponent(attributeOccurrence.Registration, Enumerable.Empty <Parameter>());

                // oversimplification for the sake of evolving
                return PerformInvoke(context, attributeOccurrence.MethodInfo, serviceInstance);
            });
        }
コード例 #3
0
 private Func<DisplayContext, Task<IHtmlContent>> CreateDelegate(
     ShapeAttributeOccurrence attributeOccurrence,
     ShapeDescriptor descriptor)
 {
     return context =>
     {
         var serviceInstance = _componentContext.GetService(attributeOccurrence.ServiceType);
         // oversimplification for the sake of evolving
         return PerformInvokeAsync(context, attributeOccurrence.MethodInfo, serviceInstance);
     };
 }
コード例 #4
0
 private Func <DisplayContext, Task <IHtmlContent> > CreateDelegate(
     ShapeAttributeOccurrence attributeOccurrence,
     ShapeDescriptor descriptor)
 {
     return(context =>
     {
         var serviceInstance = context.ServiceProvider.GetService(attributeOccurrence.ServiceType);
         // oversimplification for the sake of evolving
         return PerformInvokeAsync(context, attributeOccurrence.MethodInfo, serviceInstance);
     });
 }