asp.net-core.net-corecustom-model-binder

Missing TaskCache class in .NET Core 2


I have created a Custom Model Binder in .NET Core 1.x . It works well as shown in the official tutorial.

Once updated to 2.0, I can't compile it anymore. In the old version it was

return TaskCache.CompletedTask; 

Now the TaskCache static class isn't available anymore.

Does any know a workaround?


Solution

  • TaskCache.CompletedTask was removed in .Net Core 2. Instead just use Task.CompletedTask.