private async Task <string> CreateLoanFromImportFileInternalAsync(HttpContent content, Loan loan, bool populate, CreateLoanOptions createLoanOptions, CancellationToken cancellationToken) { var loanId = await PostPopulateDirtyAsync("importers/loan", createLoanOptions?.ToQueryParameters().ToString(), content, nameof(CreateLoanFromImportFileAsync), loan, populate, cancellationToken).ConfigureAwait(false); loan?.Initialize(Client, loanId); return(loanId); }
/// <summary> /// Creates a new loan in Encompass with the optionally specified <paramref name="createLoanOptions"/> and returns the loan id of the loan created. /// </summary> /// <param name="loan">The loan to create.</param> /// <param name="createLoanOptions">The loan creation options.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param> /// <returns></returns> public async Task <string> CreateLoanAsync(Loan loan, CreateLoanOptions createLoanOptions, CancellationToken cancellationToken = default) { Preconditions.NotNull(loan, nameof(loan)); Preconditions.NullOrEmpty(loan.EncompassId, $"{nameof(loan)}.{nameof(loan.EncompassId)}"); var loanId = await PostPopulateDirtyAsync(null, createLoanOptions?.ToQueryParameters().ToString(), nameof(CreateLoanAsync), loan, createLoanOptions?.Populate == true, cancellationToken).ConfigureAwait(false); loan.Initialize(Client, loanId); return(loanId); }