Пример #1
0
        /// <summary>
        /// Adds the XML Serializer formatters to MVC.
        /// </summary>
        /// <param name="builder">The <see cref="IMvcBuilder"/>.</param>
        /// <returns>The <see cref="IMvcBuilder"/>.</returns>
        public static IMvcBuilder AddXmlSerializerFormatters(this IMvcBuilder builder, XmlSerializerFormatterOptions options)
        {
            ArgCheck.NotNull(nameof(builder), builder);

            MvcCoreBuilderExtensions.AddXmlSerializerFormatterServices(builder.Services, options);
            return builder;
        }
Пример #2
0
        /// <summary>
        /// Adds the text formatters to MVC.
        /// </summary>
        /// <param name="builder">The <see cref="IMvcBuilder"/>.</param>
        /// <returns>The <see cref="IMvcBuilder"/>.</returns>
        public static IMvcBuilder AddTextFormatters(this IMvcBuilder builder)
        {
            ArgCheck.NotNull(nameof(builder), builder);

            MvcCoreBuilderExtensions.AddTextFormatterServices(builder.Services);
            return builder;
        }