Files
monorepo/LCU.API.Internal.OnlineLoanApp/CRIF.ACTion/Common/Builders/CrifRequestSection.cs
T
2026-03-11 11:18:25 -05:00

45 lines
1.2 KiB
C#

using System.Xml.Linq;
using CRIF.ACTion.Configuration;
namespace CRIF.ACTion.Common.Builders
{
public class CrifRequestSection : IBuildable
{
private readonly XNamespace SectionNamespace;
private readonly string SectionName;
private readonly List<XObject> Content;
private readonly List<XObject> Attributes;
private protected readonly CrifSettings _settings;
private protected CrifRequestSection(XNamespace sectionNamespace, string sectionName, CrifSettings settings)
{
SectionNamespace = sectionNamespace;
SectionName = sectionName;
Content = [];
Attributes = [];
_settings = settings;
}
public XElement Build(params XElement[] content)
{
var element = new XElement(SectionNamespace + SectionName, Attributes);
element.Add([.. Content]);
return element;
}
public void AddContent(XObject element)
{
Content.Add(element);
}
public void AddAttribute(XObject attribute)
{
Attributes.Add(attribute);
}
}
}