---
title: BillService
summary: API reference for BillService.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Domain
reference_type: package
---

# BillService

`BillService` wraps a single `EbillService` entity and provides the rendering/referring provider-assignment behaviour [OP-DOM-05](../../operations-processes.md#op-dom-05) `BillServiceIndexer` uses when it resolves each e-bill service's rendering location and stamps the result onto the service record ([DOM-BR-040](../../business-rules.md#dom-br-040-service-indexing)–[DOM-BR-042](../../business-rules.md#dom-br-042-service-indexing)).

## Purpose
- Assigns the resolved rendering provider location onto an e-bill service and records the update date/user, implementing the assignment step of `BillServiceIndexer.IndexBillServices` ([OP-DOM-05](../../operations-processes.md#op-dom-05)).
- Assigns the resolved referring provider location onto an e-bill service the same way, for services that carry a referring provider.

## Context
- Namespace: `SAIF.Domain.Model.Claims.Ebilling`
- Assembly/package: `SAIF.Domain` (packaged in `SAIF.SAIFCode.Core`)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| BillService (constructor) | `public BillService(EbillService service, string updateUser)` | Wraps `service` and captures `updateUser` as the identity to stamp on future updates; requires `updateUser` to be non-null/non-whitespace. |
| SetRenderingProvider | `public void SetRenderingProvider(ProviderLocation provider)` | Sets the service's rendering-provider location to `provider` and stamps the update date/user ([DOM-BR-040](../../business-rules.md#dom-br-040-service-indexing)–[DOM-BR-042](../../business-rules.md#dom-br-042-service-indexing)). |
| SetReferringProvider | `public void SetReferringProvider(ProviderLocation provider)` | Sets the service's referring-provider location to `provider` and stamps the update date/user. |

## Inherited public members

Members in this section are inherited from `DomainBase<TItem>` in `SAIF.Domain`. They are available on this type through direct inheritance.

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| HasData | `public virtual bool HasData { get; }` | Reports whether the wrapped `EbillService` entity is present, evaluated as `!DataItem.IsNull()`. | `SAIF.Domain` — `DomainBase<TItem>` |

## Behavioral notes
- `BillService` derives directly from `DomainBase<EbillService>` rather than `DomainRepositoryBase<TItem>`, so it has no `Factory`/repository access of its own; it only mutates the wrapped entity's in-memory state, relying on the caller's unit of work to persist the change*.

## Constraints and usage notes
- The constructor throws if `updateUser` is null or whitespace, so callers must resolve the acting user before wrapping a service.

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts.

## Sources
- `Domain/SAIF.Domain/Model/Claims/Ebilling/BillService.cs`
- `Domain/SAIF.Domain/DomainBase.cs`
