title: Sync Invoke Component in ASP.NET MVC Core 1.0
body: <p>I am trying to Invoke a Sync component using ASP.NET Core 1.0 so I have:</p>
  
  <pre><code>public class ExampleViewComponent : ViewComponent {
  
    public IViewComponentResult InvokeAsync() {
      ExampleModel model = new ExampleModel(2);
      return View(model);
    }
  
  }
  </code></pre>
  
  <p>And trying to invoke it as follows:</p>
  
  <p>@Component.InvokeAsync("Example")    </p>
  
  <p>But I then get the error:</p>
  
  <pre><code>InvalidOperationException: Method 'InvokeAsync' of view component 'MVCApp.Components.ExampleViewComponent' should be declared to return Task&lt;T&gt;.    
  </code></pre>
  
  <p>I am using InvokeAsync because Invoke was removed in 1.0.</p>
  
  <p>How should I do this?</p>