public AccountModelHandler(RepositoryContext dbContext, IConverter modelConverter, IEventPublisher eventPublisher, DateTime statusDate, bool includeCreditInformation, bool includePostingLines, bool fromPostingLineModelHandler = false) : base(dbContext, modelConverter, eventPublisher, statusDate, includePostingLines, includePostingLines ? new PostingLineModelHandler(dbContext, modelConverter, eventPublisher, DateTime.MinValue, statusDate, false, false) : null, fromPostingLineModelHandler) { _includeCreditInformation = includeCreditInformation; if (_includeCreditInformation) { _creditInfoModelHandler = new CreditInfoModelHandler(dbContext, modelConverter, EventPublisher, StatusDate); } }
private static async Task <List <CreditInfoModel> > OnReadAsync(AccountModel accountModel, IReadOnlyCollection <CreditInfoModel> creditInfoModelCollection, CreditInfoModelHandler creditInfoModelHandler) { NullGuard.NotNull(accountModel, nameof(accountModel)); if (creditInfoModelCollection == null || creditInfoModelHandler == null) { return(accountModel.CreditInfos); } if (accountModel.CreditInfos == null) { accountModel.ExtractCreditInfos(creditInfoModelCollection); } return((await creditInfoModelHandler.ReadAsync(accountModel.CreditInfos)).ToList()); }