Beispiel #1
0
 /// <summary>
 /// Adds resource handling
 /// </summary>
 /// <param name="serviceCollection"></param>
 /// <param name="resourceHandlerRegistration"></param>
 /// <returns></returns>
 public static IServiceCollection AddFimsResourceHandling(this IServiceCollection serviceCollection,
                                                          IResourceHandlerRegistration resourceHandlerRegistration)
 {
     return(serviceCollection.AddFimsResourceHandling(resourceHandlerRegistration != null
                                                          ? resourceHandlerRegistration.Register
                                                          : default(Action <ResourceHandlerRegistryOptions>)));
 }
Beispiel #2
0
 /// <summary>
 /// Registers resource API-related services
 /// </summary>
 /// <param name="services"></param>
 /// <param name="resourceHandlerRegistration"></param>
 /// <param name="addConfig"></param>
 /// <returns></returns>
 public static IServiceCollection AddMcmaResourceApi(this IServiceCollection services,
                                                     IResourceHandlerRegistration resourceHandlerRegistration,
                                                     Action <IConfigurationBuilder> addConfig = null)
 => services
 .AddMcmaAzure(addConfig)
 .AddMcmaResourceHandling(resourceHandlerRegistration)
 .AddMcmaServerDefaultApi()
 .AddScoped <IRequest, HttpRequestWrapper>()
 .AddScoped <IMcmaAzureResourceApi, McmaAzureResourceApi>();