---
title: EbillBatchQueryProvider
summary: API reference for EbillBatchQueryProvider.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# EbillBatchQueryProvider

Query provider exposing 6 data-access operation(s) (`GetBatch`, `GetBatchStatus`, `GetBatchType`, `GetBatchTypeCode`, `GetFirstBatch`, `GetLastBatch`) against 4 distinct table(s); see [sql/index.md](../../sql/index.md) for the full ORM operation catalog.

## Purpose
- Provides read/write access to 4 table(s) via NHibernate `IQueryable<T>`/`GetRepository<T>()` calls documented in [sql/index.md](../../sql/index.md).
- Exposes 6 public query/command method(s) consumed by higher application layers; see [database-tables.md](../../database-tables.md) for the underlying schema.

## Context
- Namespace: `SAIF.Data.Queries.Claims.Ebilling`
- Assembly/package: `SAIF.Data`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetBatch | `EbillBatch GetBatch(long batchId)` | Executes an ORM query ([SQL-078](../../sql/SQL-078-ebill-batch-query-provider-get-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch). |
| GetBatch | `EbillBatch GetBatch(long batchId, EbillClearinghouse clearinghouse)` | Executes an ORM query ([SQL-078](../../sql/SQL-078-ebill-batch-query-provider-get-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch). |
| GetBatch | `EbillBatch GetBatch(string batchType, DateTime fileDateTime)` | Executes an ORM query ([SQL-078](../../sql/SQL-078-ebill-batch-query-provider-get-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch). |
| GetBatch | `EbillBatch GetBatch(string batchType, DateTime fileDateTime, EbillClearinghouse clearinghouse)` | Executes an ORM query ([SQL-078](../../sql/SQL-078-ebill-batch-query-provider-get-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch). |
| GetFirstBatch | `EbillBatch GetFirstBatch(string batchType, string batchStatus)` | Executes an ORM query ([SQL-082](../../sql/SQL-082-ebill-batch-query-provider-get-first-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_BATCH_TYPE_CODE](../../database-tables.md#ebill_batch_type_code), [EBILL_BATCH_STATUS_CODE](../../database-tables.md#ebill_batch_status_code). |
| GetFirstBatch | `EbillBatch GetFirstBatch(string batchType, string batchStatus,EbillClearinghouse clearinghouse)` | Executes an ORM query ([SQL-082](../../sql/SQL-082-ebill-batch-query-provider-get-first-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_BATCH_TYPE_CODE](../../database-tables.md#ebill_batch_type_code), [EBILL_BATCH_STATUS_CODE](../../database-tables.md#ebill_batch_status_code). |
| GetLastBatch | `EbillBatch GetLastBatch(string batchType)` | Executes an ORM query ([SQL-084](../../sql/SQL-084-ebill-batch-query-provider-get-last-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_BATCH_TYPE_CODE](../../database-tables.md#ebill_batch_type_code). |
| GetLastBatch | `EbillBatch GetLastBatch(string batchType, EbillClearinghouse clearinghouse)` | Executes an ORM query ([SQL-084](../../sql/SQL-084-ebill-batch-query-provider-get-last-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_BATCH_TYPE_CODE](../../database-tables.md#ebill_batch_type_code). |
| GetLastBatch | `EbillBatch GetLastBatch(string batchType, string batchStatus)` | Executes an ORM query ([SQL-084](../../sql/SQL-084-ebill-batch-query-provider-get-last-batch.md)) against [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_BATCH_TYPE_CODE](../../database-tables.md#ebill_batch_type_code). |
| GetBatchType | `EbillBatchTypeCode GetBatchType(string code)` | Executes an ORM query ([SQL-087](../../sql/SQL-087-ebill-batch-query-provider-get-batch-type.md)) against [EBILL_BATCH_TYPE_CODE](../../database-tables.md#ebill_batch_type_code). |
| GetBatchTypeEbill | `EbillBatchTypeCode GetBatchTypeEbill()` | Retrieves batch type ebill.* |
| GetBatchTypePaymentAdvice | `EbillBatchTypeCode GetBatchTypePaymentAdvice()` | Retrieves batch type payment advice.* |
| GetBatchTypeCode | `EbillBatchTypeCode GetBatchTypeCode(string batchTypeCode)` | Executes an ORM query ([SQL-088](../../sql/SQL-088-ebill-batch-query-provider-get-batch-type-code.md)) against [EBILL_BATCH_TYPE_CODE](../../database-tables.md#ebill_batch_type_code). |
| GetBatchStatus | `EbillBatchStatusCode GetBatchStatus(string code)` | Executes an ORM query ([SQL-089](../../sql/SQL-089-ebill-batch-query-provider-get-batch-status.md)) against [EBILL_BATCH_STATUS_CODE](../../database-tables.md#ebill_batch_status_code). |
| EbillBatchQueryProvider(IRepositoryFactory factory) | `EbillBatchQueryProvider(IRepositoryFactory factory)` | Initializes a new instance, wiring the repository factory used by this provider's query methods.* |

## Behavioral notes
- Query methods build LINQ expressions over `IQueryable<T>` obtained via `Factory.GetRepository<T>()` and execute them against the underlying NHibernate session.*

## Constraints and usage notes
- Instances are constructed with an `IRepositoryFactory` and are expected to be resolved through dependency injection rather than instantiated directly.*

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillBatchQueryProvider.cs`
