Пример #1
0
 private static ActionConstraintCache GetActionConstraintCache(IActionConstraintProvider[] actionConstraintProviders = null)
 {
     var services = new ServiceCollection().BuildServiceProvider();
     var descriptorProvider = new ActionDescriptorCollectionProvider(services);
     return new ActionConstraintCache(descriptorProvider, actionConstraintProviders.AsEnumerable() ?? new List<IActionConstraintProvider>());
 }