src/Cake.Yaml/YamlAliases.cs
/// <summary>
/// Serializes an object to a YAML file.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="filename">The filename to serialize to.</param>
/// <param name="instance">The object to serialize.</param>
/// <param name="settings">The <see cref="SerializeYamlSettings"/> that will be used to build the serializer.</param>
/// <typeparam name="T">The type of object to serialize.</typeparam>
Serializes an object to a YAML file.
Serializes an object to a YAML file .
[CakeMethodAlias]
        public static void SerializeYamlToFile<T>(this ICakeContext context, FilePath filename, T instance, SerializeYamlSettings settings)
        {
            if (settings is null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            var s = BuildSerializer(settings);
            using (var tw = new StreamWriter(File.Open(filename.MakeAbsolute(context.Environment).FullPath, FileMode.Create)))
            {
                s.Serialize(tw, instance);
            }
        }
[ CakeMethodAlias ] public static void SerializeYamlToFile < T > ( this ICakeContext context , FilePath filename , T instance , SerializeYamlSettings settings ) { if ( settings is null ) { throw new ArgumentNullException ( nameof ( settings ) ) ; } var s = BuildSerializer ( settings ) ; using ( var tw = new StreamWriter ( File . Open ( filename . MakeAbsolute ( context . Environment ) . FullPath , FileMode . Create ) ) ) { s . Serialize ( tw , instance ) ; } }
Serializes an object to a YAML file.
Serializes an object to a YAML file .
ICakeContext
this
filename
FilePath
The filename to serialize to.
The filename to serialize to .
instance
T
The object to serialize.
The object to serialize .
settings
SerializeYamlSettings
The  that will be used to build the serializer.
The that will be used to build the serializer .
context
None
typeparam
The type of object to serialize.
The type of object to serialize .