using System.Xml.Linq;
namespace MfGames.Nitride.Feeds.Structure;
///
/// The type-safe structure for an author element.
///
[WithProperties]
public partial class AtomAuthor
{
///
/// Gets or sets the name of the author.
///
public string? Name { get; set; }
///
/// Creates an XML element out of the feed along with all items inside
/// the feed.
///
///
public XElement? ToXElement()
{
if (this.Name == null)
{
return null;
}
var author = new XElement(XmlConstants.AtomNamespace + "author");
if (!string.IsNullOrEmpty(this.Name))
{
author.Add(new XElement(XmlConstants.AtomNamespace + "name", new XText(this.Name)));
}
return author;
}
}