Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created June 10, 2021 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/025750f3c7f18555c8589086a880d7a3 to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/025750f3c7f18555c8589086a880d7a3 to your computer and use it in GitHub Desktop.
.NET Core Web API - Add XML Serializer Formatters
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers().AddXmlSerializerFormatters();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "WebApiFormatters", Version = "v1" });
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment