13 lines
295 B
Python
13 lines
295 B
Python
from __future__ import annotations
|
|
|
|
from collections.abc import Generator
|
|
|
|
from services.unit_of_work import UnitOfWork
|
|
|
|
|
|
def get_unit_of_work() -> Generator[UnitOfWork, None, None]:
|
|
"""FastAPI dependency yielding a unit-of-work instance."""
|
|
|
|
with UnitOfWork() as uow:
|
|
yield uow
|