/// <summary> /// Adds all endpoints from a assembly to the manifest /// </summary> /// <param name="builder">The current instance of the manifest builder</param> /// <param name="assembly">Assembly to search for endpoints</param> /// <returns>Same instance of the manifest builder</returns> public static EndpointManifestBuilder AddFromAssembly(this EndpointManifestBuilder builder, Assembly assembly) { foreach (var endpoint in assembly.DefinedTypes.Where(IsRequestEndpoint)) { builder.AddForEndpoint(endpoint); } return(builder); }
/// <summary> /// Add Endpoints For Implementation of IEndpoint; /// </summary> /// <param name="builder">The current instance of the manifest builder</param> /// <param name="endpoint">Type of IEndpoint to be added</param> /// <returns>Same instance of the manifest builder</returns> public static EndpointManifestBuilder AddForEndpoint(this EndpointManifestBuilder builder, Type endpoint) { builder.AddEndpoint(endpoint); return(builder); }
/// <summary> /// Add Endpoints For Implementation of IEndpoint; /// </summary> /// <typeparam name="TEndpoint">Type of IEndpoint to be added</typeparam> /// <param name="builder">The current instance of the manifest builder</param> /// <returns>Same instance of the manifest builder</returns> public static EndpointManifestBuilder AddForEndpoint <TEndpoint>(this EndpointManifestBuilder builder) where TEndpoint : IEndpoint => AddForEndpoint(builder, typeof(TEndpoint));