XdtFragmentSource Class

Summary

Represents a fragment of an XDT transformation document.

This is typically going to be a document fragment like a single <appSettings> value as opposed to a full document.

The implementation will attempt to infer the correct document structure using the default .NET <configuration> root element. For more complex use cases, it's probably most appropriate to use XdtDocumentSource or derive a class from XdtSource.

Assembly
Cake.XdtTransform.dll
Namespace
Cake.XdtTransform
Base Types
graph BT Type-->Base0["XdtSource"] click Base0 "/api/Cake.XdtTransform/XdtSource" Base0-->Base1["Object"] Type["XdtFragmentSource"] class Type type-node

Syntax

public sealed class XdtFragmentSource : XdtSource

Examples

var transform = "<appSettings><add key="key-name" value="key-value" xdt:Locator="Match(key)" xdt:Transform="SetAttributes" /></appSettings>";
var fragmentSource = new XdtFragmentSource(transform);

Constructors

Name Summary
XdtFragmentSource(string) Initializes a new instance of the XdtFileSource class.

Methods

Name Value Summary
GetXdtStream() Stream
Gets the Stream representing the transformation document.

Extension Methods

Name Value Summary
Dump<XdtFragmentSource>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<XdtFragmentSource>(XdtFragmentSource[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<XdtFragmentSource>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<XdtFragmentSource>(string) void
Requires the Cake.Issues addin
ThrowIfNull<XdtFragmentSource>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<XdtFragmentSource>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Requires the Cake.Issues addin