GroupRepository¶
GroupRepository is a small RepositoryBase<GroupAssociation> implementation that resolves group ids to GroupAssociation entities (mapped to group_association) for the group-imaging subsystem; it has no filtering or write behavior of its own beyond the inherited generic CRUD surface.
Purpose¶
- Look up a
GroupAssociationby its group id, with an existence-check helper (GroupFound) and both throwing/non-throwing lookup variants (GetGroup/GetGroupOrDefault).
Context¶
- Namespace:
SAIF.Data.NHibernate.Repositories.Groups - Assembly/package:
SAIF.Data.NHibernate(ships inside theSAIF.SAIFCode.CoreNuGet package) - Base class:
RepositoryBase<GroupAssociation>fromSAIF.Framework.Data.NHibernate(external, resolved via Legends CLI — see Inherited public members below). - Implements:
IGroupRepository, defined inSAIF.Data.Interfaces.Repositories.Groups.
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| GroupRepository(NHibernateUnitOfWork) | public GroupRepository(NHibernateUnitOfWork uow) |
Constructor; passes uow to the RepositoryBase<GroupAssociation> base. |
| GroupFound | public bool GroupFound(string groupId) |
Returns true if a GroupAssociation with the given group id exists, by calling GetGroupOrDefault and checking for a non-null result (SQL-026). |
| GetGroupOrDefault | public GroupAssociation GetGroupOrDefault(string groupId) |
Returns the single GroupAssociation matching groupId via Query().SingleOrDefault(), or null if none exists (SQL-027). |
| GetGroup | public GroupAssociation GetGroup(string groupId) |
Returns the single GroupAssociation matching groupId via Query().Single(), throwing if none exists (SQL-028). |
Inherited public members¶
Members in this section are inherited from RepositoryBase<GroupAssociation> in SAIF.Framework.Data.NHibernate. They are available on this type through inheritance.
| Member | Signature | Purpose | Origin |
|---|---|---|---|
| Add | public void Add(GroupAssociation entity) |
Registers a new GroupAssociation entity for insertion on the next unit-of-work commit.† |
SAIF.Framework.Data.NHibernate — RepositoryBase<GroupAssociation> |
| Update | public void Update(GroupAssociation entity) |
Marks an existing GroupAssociation entity as modified for the next unit-of-work commit.† |
SAIF.Framework.Data.NHibernate — RepositoryBase<GroupAssociation> |
| Delete | public void Delete(GroupAssociation entity) |
Registers a GroupAssociation entity for deletion on the next unit-of-work commit.† |
SAIF.Framework.Data.NHibernate — RepositoryBase<GroupAssociation> |
| Query | public IQueryable<GroupAssociation> Query() |
Returns a LINQ-queryable session projection over GroupAssociation, used directly by GetGroup/GetGroupOrDefault above.† |
SAIF.Framework.Data.NHibernate — RepositoryBase<GroupAssociation> |
| Get | public GroupAssociation Get(object id) |
Loads a GroupAssociation by primary key, returning null if not found.† |
SAIF.Framework.Data.NHibernate — RepositoryBase<GroupAssociation> |
| Load | public GroupAssociation Load(object id) |
Loads a GroupAssociation by primary key as a (possibly proxied) reference, throwing if not found.† |
SAIF.Framework.Data.NHibernate — RepositoryBase<GroupAssociation> |
| SystemDate | public DateTime SystemDate { get; } |
Current system date/time as tracked by the underlying session/unit of work.† | SAIF.Framework.Data.NHibernate — RepositoryBase<GroupAssociation> |
Behavioral notes¶
- All three of this type's own members are thin wrappers over the inherited
Query()LINQ surface; there is no custom filtering, eager-loading, or write logic*.
Constraints and usage notes¶
GetGroupthrows (Single()) if noGroupAssociationmatches the suppliedgroupId; useGetGroupOrDefaultorGroupFoundfirst when existence is not guaranteed.
Note: Statements marked with
†are derived from dependency library documentation via the Legends CLI. Statements marked with*were inferred from code structure or contextual evidence. Statements marked with**could not be confirmed; treat as unknown until verified.
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Operations and processes
- Business rules
- Database tables
- SQL catalog
- Procedures
- Security and authorization
- API reference
Sources¶
Data/SAIF.Data.NHibernate/Repositories/Groups/GroupRepository.cs