< Summary

Information
Class: Elsa.Expressions.JavaScript.Extensions.DependencyInjectionExtensions
Assembly: Elsa.Expressions.JavaScript
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/Extensions/DependencyInjectionExtensions.cs
Line coverage
50%
Covered lines: 3
Uncovered lines: 3
Coverable lines: 6
Total lines: 57
Line coverage: 50%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/Extensions/DependencyInjectionExtensions.cs

#LineLine coverage
 1using Elsa.Expressions.JavaScript.TypeDefinitions.Contracts;
 2using Microsoft.Extensions.DependencyInjection;
 3
 4namespace Elsa.Expressions.JavaScript.Extensions;
 5
 6/// <summary>
 7/// Provides extension methods for <see cref="IServiceCollection"/>.
 8/// </summary>
 9public static class DependencyInjectionExtensions
 10{
 11    /// <summary>
 12    /// Adds a <see cref="IFunctionDefinitionProvider"/> to the service collection.
 13    /// </summary>
 14    /// <param name="services">The service collection.</param>
 15    /// <typeparam name="T">The type of the function definition provider.</typeparam>
 16    /// <returns>The service collection.</returns>
 94017    public static IServiceCollection AddFunctionDefinitionProvider<T>(this IServiceCollection services) where T: class, 
 18
 19    /// <summary>
 20    /// Adds a <see cref="IFunctionDefinitionProvider"/> to the service collection.
 21    /// </summary>
 22    /// <param name="services">The service collection.</param>
 23    /// <param name="factory">A callback to create the function definition provider.</param>
 24    /// <typeparam name="T">The type of the function definition provider.</typeparam>
 25    /// <returns>The service collection.</returns>
 26    public static IServiceCollection AddFunctionDefinitionProvider<T>(this IServiceCollection services, Func<IServicePro
 027        services.AddScoped<IFunctionDefinitionProvider, T>(factory);
 28
 29    /// <summary>
 30    /// Adds a <see cref="ITypeDefinitionProvider"/> to the service collection.
 31    /// </summary>
 32    /// <param name="services">The service collection.</param>
 33    /// <typeparam name="T">The type of the type definition provider.</typeparam>
 34    /// <returns>The service collection.</returns>
 70535    public static IServiceCollection AddTypeDefinitionProvider<T>(this IServiceCollection services) where T: class, ITyp
 36
 37    /// <summary>
 38    /// Adds a <see cref="ITypeDefinitionProvider"/> to the service collection.
 39    /// </summary>
 40    /// <param name="services">The service collection.</param>
 41    /// <param name="factory">A callback to create the type definition provider.</param>
 42    /// <typeparam name="T">The type of the type definition provider.</typeparam>
 43    /// <returns>The service collection.</returns>
 44    public static IServiceCollection AddTypeDefinitionProvider<T>(this IServiceCollection services, Func<IServiceProvide
 045        services.AddScoped<ITypeDefinitionProvider, T>();
 46
 47    /// <summary>
 48    /// Adds a <see cref="IVariableDefinitionProvider"/> to the service collection.
 49    /// </summary>
 23550    public static IServiceCollection AddVariableDefinitionProvider<T>(this IServiceCollection services) where T: class, 
 51
 52    /// <summary>
 53    /// Adds a <see cref="IVariableDefinitionProvider"/> to the service collection.
 54    /// </summary>
 55    public static IServiceCollection AddVariableDefinitionProvider<T>(this IServiceCollection services, Func<IServicePro
 056        services.AddScoped<IVariableDefinitionProvider, T>(factory);
 57}