26 lines
754 B
C#
26 lines
754 B
C#
using System.Xml.Linq;
|
|
using CRIF.ACTion.Common.Parsers;
|
|
using Landmark.OLA.Models.Loan;
|
|
|
|
namespace CRIF.ACTion.Loan
|
|
{
|
|
public class LoanApplicationResponseParser : IResponseParser<LoanApplication>
|
|
{
|
|
public LoanApplication Parse(XElement xdoc)
|
|
{
|
|
try
|
|
{
|
|
//TODO: This entire parser should be rewritten to use proper XPath-style lookups
|
|
|
|
var idElement = (XElement)((XElement)((XElement)((XElement)xdoc.FirstNode).FirstNode).FirstNode).NextNode;
|
|
|
|
return new LoanApplication(loanId: idElement.Value);
|
|
}
|
|
catch
|
|
{
|
|
throw new FormatException("CRIF XML is in an unexpected layout.");
|
|
}
|
|
}
|
|
}
|
|
}
|