public IList<Auction.Domain.Package> GetByBidder(long bidderId,
                          ref IAuctionTransaction trans)
 {
     using (var records = new PackageCollection())
     {
         var filter = new PredicateExpression(PackageFields.BidderId == bidderId);
         if (trans != null)
         {
             trans.Add(records);
         }
         records.GetMulti(filter);
         return records.Select(r => new Package()
         {
             BidderId = r.BidderId,
             CategoryId = r.CategoryId,
             ClosedOutBy = r.ClosedOutBy,
             Code = r.Code,
             CreatedBy = r.CreatedBy,
             EndingBid = r.EndingBid,
             EventId = r.EventId,
             Id = r.Id,
             Name = r.Name,
             Notes = r.Notes,
             Paid = (bool)r.Paid,
             StartingBid = r.StartingBid,
             UpdatedBy = r.UpdatedBy
         }).ToList();
     }
 }
 public Auction.Domain.Package Get(long Id, ref IAuctionTransaction trans)
 {
     using (var records = new PackageCollection())
     {
         var filter = new PredicateExpression(PackageFields.Id == Id);
         if (trans != null)
         {
             trans.Add(records);
         }
         records.GetMulti(filter, 1);
         var r = records.FirstOrDefault();
         return new Package()
                    {
                        BidderId = r.BidderId,
                        CategoryId = r.CategoryId,
                        ClosedOutBy = r.ClosedOutBy,
                        Code = r.Code,
                        CreatedBy = r.CreatedBy,
                        EndingBid = r.EndingBid,
                        EventId = r.EventId,
                        Id = r.Id,
                        Name = r.Name,
                        Notes = r.Notes,
                        Paid = (bool) r.Paid,
                        StartingBid = r.StartingBid,
                        UpdatedBy = r.UpdatedBy
                    };
     }
 }