internal static IPostingLine ToDomain(this PostingLineModel postingLineModel, IAccounting accounting, IContactAccount contactAccount, MapperCache mapperCache, IConverter accountingModelConverter)
        {
            NullGuard.NotNull(postingLineModel, nameof(postingLineModel))
            .NotNull(accounting, nameof(accounting))
            .NotNull(contactAccount, nameof(contactAccount))
            .NotNull(mapperCache, nameof(mapperCache))
            .NotNull(accountingModelConverter, nameof(accountingModelConverter));

            IAccount       account       = ResolveAccount(postingLineModel.Account, accounting, mapperCache, accountingModelConverter);
            IBudgetAccount budgetAccount = ResolveBudgetAccount(postingLineModel.BudgetAccount, accounting, mapperCache, accountingModelConverter);

            return(postingLineModel.ToDomain(account, budgetAccount, contactAccount, mapperCache));
        }
        internal static IPostingLine ToDomain(this PostingLineModel postingLineModel, MapperCache mapperCache, IConverter accountingModelConverter)
        {
            NullGuard.NotNull(postingLineModel, nameof(postingLineModel))
            .NotNull(mapperCache, nameof(mapperCache))
            .NotNull(accountingModelConverter, nameof(accountingModelConverter));

            lock (mapperCache.SyncRoot)
            {
                IAccounting accounting = accountingModelConverter.Convert <AccountingModel, IAccounting>(postingLineModel.Accounting);

                return(postingLineModel.ToDomain(accounting, mapperCache, accountingModelConverter));
            }
        }