public IList<Auction.Domain.Event> GetByAccount(long accountId,
                           ref IAuctionTransaction trans)
 {
     using (var records = new AuctionEventCollection())
     {
         var filter = new PredicateExpression(AuctionEventFields.AccountId == accountId);
         if (trans != null)
         {
             trans.Add(records);
         }
         records.GetMulti(filter, 0);
         return
             records.Select(
                 b =>
                 new Event()
                     {
                         Id = b.Id,
                         Date = b.Date,
                         Name = b.Name,
                         AccountId = b.AccountId,
                         CreatedBy = b.CreatedBy,
                         Locked = b.Locked,
                         Notes = b.Notes,
                         UpdatedBy = b.UpdatedBy
                     }).ToList();
     }
 }
        public Event Get(long Id, ref IAuctionTransaction trans)
        {
            using (var records = new AuctionEventCollection())
            {
                var filter = new PredicateExpression(AuctionEventFields.Id == Id);

                if (trans != null)
                {
                    trans.Add(records);
                }
                records.GetMulti(filter, 1);
                var b = records.ToList().FirstOrDefault();
                return new Event()
                {
                    Id = Id,
                    Date = b.Date,
                    Name = b.Name,
                    AccountId = b.AccountId,
                    CreatedBy = b.CreatedBy,
                    Locked = b.Locked,
                    Notes = b.Notes,
                    UpdatedBy = b.UpdatedBy
                };
            }
        }