public Ticket Build() { if (_ticketType == null) { throw new ArgumentNullException(); } if (_department == null) { throw new ArgumentNullException(); } var result = new Ticket { TicketTypeId = _ticketType.Id, DepartmentId = _department.Id, ExchangeRate = _exchangeRate, TaxIncluded = _taxIncluded, TransactionDocument = new AccountTransactionDocument() }; foreach (var orderData in _orders) { result.AddOrder(orderData.Order, orderData.TaxTemplates, orderData.TransactionType, orderData.UserName); } foreach (var calculation in _calculations) { result.AddCalculation(calculation, calculation.Amount); } result.Recalculate(); return(result); }