---
title: "SQL-145: Retrieve ClaimSeverityModelActivity via ClaimSeverityModelActivityQuery (property)"
summary: Read operation against ClaimSeverityModelActivity via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-145: Retrieve ClaimSeverityModelActivity via ClaimSeverityModelActivityQuery (property)

This ORM statement performs a read operation on `ClaimSeverityModelActivity` via `IUnitOfWork.GetRepository<T>()`, executed from `Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs (L22)`.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| (none) | N/A | N/A | N/A | No inline filter — full-entity read (`Query().ToList()`/projection) or filters appended later |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CSGSEV_CLM_SGMNTN_ACTIONS_SENT](../database-tables.md#csgsev_clm_sgmntn_actions_sent) | SELECT | `ACTIONS_SENT_ID`, `CLM_ID`, `ACTION_DESC`, `ACTION_ROLE` |

## LINQ statement

Source: `Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs:22`

```csharp
// Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs:22
        private IQueryable<ClaimSeverityModelActivity> ClaimSeverityModelActivityQuery => _sqlServerUnitOfWork.GetRepository<ClaimSeverityModelActivity>().Query();

// Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs:39
            _severityModelActivities = ClaimSeverityModelActivityQuery.OrderBy(x => x.ClaimId).OrderBy(x => x.ActionDescription).ToList();
```

## 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
-- Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs:22 (materialized at L39)
SELECT
  CCSAS.ACTIONS_SENT_ID,
  CCSAS.CLM_ID,
  CCSAS.ACTION_DESC,
  CCSAS.ACTION_ROLE
FROM CSGSEV_CLM_SGMNTN_ACTIONS_SENT CCSAS
ORDER BY CCSAS.ACTION_DESC
```

Translation notes:
- Dialect: the repository comes from `_sqlServerUnitOfWork` (constructor parameter `IUnitOfWork sqlServerUOW`, L28-32) -> SQL Server (`MsSqlConfiguration.MsSql2008`, Legends Q4); the DI binding itself is outside this repository, so the dialect is inferred from the naming. No bind variables or paging are involved, so the SQL text is identical in both dialects.
- `OrderBy(x => x.ClaimId).OrderBy(x => x.ActionDescription)`: the second `OrderBy` replaces the first as the primary key (LINQ semantics) -> `ORDER BY ACTION_DESC`. Depending on NHibernate version the superseded `CLM_ID` key may be emitted as a secondary sort or dropped.

## Operations and processes
- SeverityModelActivityService.ClaimSeverityModelActivityQuery (property) — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs (L22)`
