The FluentSerializer.Xml.DependencyInjection.NetCoreDefault library is responsible for registering the FluentSerializer for XML using
Microsoft.Extensions.DependencyInjection.Abstractions.
For basic usage you can use this:
serviceCollection.AddFluentXmlSerializer<TAssemblyMarker>();This will use the XmlSerializerConfiguration.Default as the applied config.
The type parameter of TAssemblyMarker will be used to scan that assembly for the profiles associated with this serializer.
Alternatively there are overloads that accept a System.Reflection.Assembly variable.
There are multiple overloads, for changing configuration the lambda approach is recommended:
serviceCollection.AddFluentXmlSerializer<TAssemblyMarker>(static configuration =>
{
// Change configuration values
configuration.NewLine = LineEndings.LineFeed;
});This will use a new instance of XmlSerializerConfiguration as the applied config and allows you to change some properties.
See the default values.