Esempio n. 1
0
        /// <summary>
        /// Use Api description from Swagger
        /// </summary>
        /// <param name="builder">The builder instance.</param>
        /// <param name="setupAction">Delegate to define the options</param>
        /// <returns></returns>
        public static IServiceRepositoryAgentBuilder UseSwagger(this IServiceRepositoryAgentBuilder builder, Action <SwaggerOptions> setupAction)
        {
            if (setupAction == null)
            {
                throw new ArgumentNullException(nameof(setupAction));
            }

            var options = new SwaggerOptions();

            setupAction.Invoke(options);

            return(builder.UseSwagger(options));
        }
Esempio n. 2
0
 /// <summary>
 /// Use Api description from Swagger
 /// </summary>
 /// <param name="builder">The builder instance.</param>
 /// <param name="documentName">The document name as set in the swagger configuration (e.g. "v1")</param>
 /// <returns></returns>
 public static IServiceRepositoryAgentBuilder UseSwagger(this IServiceRepositoryAgentBuilder builder, string documentName)
 {
     return(builder.UseSwagger(new SwaggerOptions {
         DocumentName = documentName
     }));
 }