public IQueryable <AcmeCertificate> AcmeCertQuery() { return(AcmeCertificates .Include(x => x.Key) .Include(x => x.AcmeAccount) .ThenInclude(x => x.Key)); }
public IQueryable <AcmeCertOrderContainer> AcmeCertOrderQuery() { return(AcmeCertificates .Include(x => x.AcmeOrders) .ThenInclude(x => x.DomainCertificate) .Select(x => new AcmeCertOrderContainer { LatestValidAcmeOrder = x.AcmeOrders .OrderByDescending(y => y.DateCreated) .FirstOrDefault(y => y.Status == AcmeOrderStatus.Completed) })); }