/// <summary> /// The get line item collection. /// </summary> /// <param name="invoiceKey"> /// The invoice key. /// </param> /// <returns> /// The <see cref="LineItemCollection"/>. /// </returns> private LineItemCollection GetLineItemCollection(Guid invoiceKey) { var sql = new Sql(); sql.Select("*").From <InvoiceItemDto>(SqlSyntax).Where <InvoiceItemDto>(x => x.ContainerKey == invoiceKey); var dtos = Database.Fetch <InvoiceItemDto>(sql); var factory = new LineItemFactory(); var collection = new LineItemCollection(); foreach (var dto in dtos) { collection.Add(factory.BuildEntity(dto)); } return(collection); }
private LineItemCollection GetLineItemCollection(Guid itemCacheKey) { var sql = new Sql(); sql.Select("*") .From <ItemCacheItemDto>() .Where <ItemCacheItemDto>(x => x.ContainerKey == itemCacheKey); var dtos = Database.Fetch <ItemCacheItemDto>(sql); //var lineItems = _lineItemRepository.GetByContainerId(itemCacheId); var factory = new LineItemFactory(); var collection = new LineItemCollection(); foreach (var dto in dtos) { collection.Add(factory.BuildEntity(dto)); } return(collection); }