---
title: "SQL-139: EbillServiceQueryProvider.GetMinimumServiceDate"
summary: Read operation for `EbillServiceQueryProvider.GetMinimumServiceDate`
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# SQL-139: EbillServiceQueryProvider.GetMinimumServiceDate

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by `EbillServiceQueryProvider.GetMinimumServiceDate`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-139 |
| **Operation type** | Read |
| **Execution method** | ORM (NHibernate LINQ) |
| **Database** | Oracle* |
| **Schema** | [unqualified]** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `EbillServiceQueryProvider` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `GetMinimumServiceDate` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `ebill` | Input | Ebill | N/A | Method argument of `EbillServiceQueryProvider.GetMinimumServiceDate` bound into the ORM expression; NHibernate generates the bind variable at runtime |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [EBILL_SERVICE](../database-tables.md#ebill_service) | SELECT (aggregate) | `BILL_SERVICE_DATE`, `EBILL_SEQ_NUM` |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Claims/Ebilling/EbillServiceQueryProvider.cs:35`

```csharp
// Data/SAIF.Data/Queries/Claims/Ebilling/EbillServiceQueryProvider.cs:18
repository = Factory.GetRepository<EbillService>().Query();

// Data/SAIF.Data/Queries/Claims/Ebilling/EbillServiceQueryProvider.cs:35
var minServiceFrom = repository.Where(x => x.Bill.Id == ebill.Id).Min(x => x.ServiceDate);
```

## Sample SQL

> **Inferred SQL:** This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

```sql
-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
SELECT MIN(ES.BILL_SERVICE_DATE)
FROM EBILL_SERVICE ES
WHERE ES.EBILL_SEQ_NUM = :ebillId
```

Translation notes:
- Direct translation: an equality predicate on mapped columns. No navigation, joins or in-memory operators.

## Operations and processes

- [E-bill processing queries](../operations/e-bill-processing-queries.md)


## Sources
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillServiceQueryProvider.cs:35`
