示例#1
0
        public HostDeposit GetByHostDepositById(long hostDepositId)
        {
            using (var adapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var linqMetaData = new LinqMetaData(adapter);

                var hostPayment = Queryable.FirstOrDefault <HostPaymentEntity>(linqMetaData.HostPayment.WithPath(prefetchPath =>
                                                                                                                 prefetchPath.Prefetch(path => path.Address).Prefetch(path => path.HostPaymentTransaction)).Where(
                                                                                   hp => hp.HostPaymentId == hostDepositId && hp.IsDeposit));
                if (hostPayment == null)
                {
                    throw new ObjectNotFoundInPersistenceException <HostPayment>(hostDepositId);
                }
                var address = _addressRepository.GetAddress(hostPayment.MailingAddressId.Value);

                return(_hostDepositFactory.CreateHostDeposit(hostPayment, address));
            }
        }
示例#2
0
 public virtual TSource FirstOrDefault <TSource>(IQueryable <TSource> source, Expression <Func <TSource, Boolean> > predicate)
 {
     return(Queryable.FirstOrDefault <TSource>(source, predicate));
 }
示例#3
0
 public virtual TSource FirstOrDefault <TSource>(IQueryable <TSource> source)
 {
     return(Queryable.FirstOrDefault <TSource>(source));
 }