first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user