/// <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 EasyEndpointBuilder WithEndpointsFromAssembly(this EasyEndpointBuilder builder, Assembly assembly) { foreach (var endpoint in assembly.DefinedTypes.Where(IsRequestEndpoint)) { builder.WithEndpoint(endpoint); } return(builder); }
private static EasyEndpointBuilder AddEmptyEasyEndpoints(this IServiceCollection services, EndpointOptions options) { services.AddTransient(ManifestHelper.BuidManifest); services.AddSingleton(options); services.AddTransient <IEasyEndpointCompositeMetadataDetailsProvider, EasyEndpointCompositeMetadataDetailsProvider>(); services.AddTransient <IApiDescriptionGroupCollectionProvider, EasyEndpointApiDescriptionGroupCollectionProvider>(); var builderOptions = new EasyEndpointBuilderOptions(); services.AddSingleton(builderOptions); services.AddTransient <IMalformedRequestExceptionHandler, DefaultIMalformedRequestExceptionHandler>(); var builder = new EasyEndpointBuilder(services, builderOptions, options); AddDefaultParsers(builder); return(builder); }
private static void AddDefaultParsers(EasyEndpointBuilder endpointBuilder) { endpointBuilder.WithParser <DefaultParsers.ByteParser>(); endpointBuilder.WithParser <DefaultParsers.UShortParser>(); endpointBuilder.WithParser <DefaultParsers.ShortParser>(); endpointBuilder.WithParser <DefaultParsers.UIntParser>(); endpointBuilder.WithParser <DefaultParsers.IntParser>(); endpointBuilder.WithParser <DefaultParsers.ULongParser>(); endpointBuilder.WithParser <DefaultParsers.LongParser>(); endpointBuilder.WithParser <DefaultParsers.FloatParser>(); endpointBuilder.WithParser <DefaultParsers.DoubleParser>(); endpointBuilder.WithParser <DefaultParsers.DecimalParser>(); endpointBuilder.WithParser <DefaultParsers.BoolParser>(); endpointBuilder.WithParser <DefaultParsers.DateTimeParser>(); endpointBuilder.WithParser <DefaultParsers.DateTimeOffsetParser>(); endpointBuilder.WithParser <DefaultParsers.DateOnlyParser>(); endpointBuilder.WithParser <DefaultParsers.TimeOnlyParser>(); endpointBuilder.WithParser <DefaultParsers.GuidParser>(); }
internal EndpointManifestBuilder(EasyEndpointBuilder builder) { this.builder = builder; }