Interface IUnitRepository
- Namespace
- adas_core.Application.Repositories.Interfaces
- Assembly
- adas-core.Application.dll
public interface IUnitRepository : IMongoRepository<Unit>
- Inherited Members
- Extension Methods
Methods
CountUnitsByMasterListId(ObjectId, MasterListType)
Asynchronously counts the number of units associated with the master list identified by the specified identifier and type.
Task<long> CountUnitsByMasterListId(ObjectId id, MasterListType masterListType)
Parameters
idObjectIdThe unique identifier of the master list whose units should be counted.
masterListTypeMasterListTypeThe type of the master list used to resolve the appropriate unit collection.
Returns
- Task<long>
A task that represents the asynchronous operation, containing the total number of units matching the specified master list.
FindById(object)
Asynchronously retrieves a Unit entity by its identifier.
Task<Unit?> FindById(object id)
Parameters
Returns
FindByMasterListId(ObjectId)
Asynchronously retrieves the collection of Unit entities associated with the specified master list identifier.
Task<IEnumerable<Unit>> FindByMasterListId(ObjectId id)
Parameters
idObjectIdThe MongoDB.Bson.ObjectId of the master list whose units are being requested.
Returns
- Task<IEnumerable<Unit>>
A task that represents the asynchronous operation. The task result contains an IEnumerable<T> with the units linked to the given master list.
FindByMasterListId(ObjectId, MasterListType)
Retrieves the collection of units associated with the specified master list identifier and master list type.
Task<IEnumerable<Unit>> FindByMasterListId(ObjectId id, MasterListType masterListType)
Parameters
idObjectIdThe unique identifier of the master list whose units should be retrieved.
masterListTypeMasterListTypeThe type of the master list used to filter or scope the unit lookup.
Returns
- Task<IEnumerable<Unit>>
A task that represents the asynchronous operation, containing the collection of units linked to the specified master list.
FindByName(string)
Asynchronously finds a unit by its section name.
Task<Unit?> FindByName(string section)
Parameters
sectionstringThe name of the section to search for.
Returns
- Task<Unit>
A task that represents the asynchronous operation. The task result contains the unit if found; otherwise, null.
GetAll()
Asynchronously retrieves all available units and returns them as a list.
Task<List<Unit>> GetAll()
Returns
- Task<List<Unit>>
A task that represents the asynchronous operation, containing a list of all Unit entities.
GetPaginatedUnits(PaginationFilter)
Retrieves a paginated collection of Unit records based on the provided pagination criteria.
IFindFluent<Unit, Unit> GetPaginatedUnits(PaginationFilter filter)
Parameters
filterPaginationFilterThe pagination filter that defines the page size, page number, and any additional filtering criteria.
Returns
- IFindFluent<Unit, Unit>
An MongoDB.Driver.IFindFluent<TDocument, TProjection> representing the fluent query for the paginated units.
InsertOneUnit(Unit)
Inserts a single Unit record and returns the inserted entity, or null if the insertion did not produce a result.
Task<Unit?> InsertOneUnit(Unit unit)
Parameters
Returns
- Task<Unit>
A task that represents the asynchronous insert operation. The task result contains the inserted Unit, or null when no unit is returned.
UpdateConfiguration(ObjectId, UnitConfiguration)
Updates the configuration of a unit identified by the specified identifier.
Task<bool> UpdateConfiguration(ObjectId unitIdParsed, UnitConfiguration unitConfiguration)
Parameters
unitIdParsedObjectIdThe parsed object identifier of the unit whose configuration will be updated.
unitConfigurationUnitConfigurationThe new configuration values to apply to the unit.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result is
trueif the configuration was successfully updated; otherwise,false.
UpdateUnit(Unit)
Updates an existing unit in the underlying store and returns the updated entity.
Task<Unit?> UpdateUnit(Unit section)
Parameters
sectionUnitThe unit containing the updated data to persist.
Returns
UpdateUnitInfo(ObjectId, string, string)
Updates the name and title of an existing unit identified by the specified identifier.
Task<Unit?> UpdateUnitInfo(ObjectId unitId, string name, string title)
Parameters
unitIdObjectIdThe unique identifier of the unit to update.
namestringThe new name to assign to the unit.
titlestringThe new title to assign to the unit.
Returns
- Task<Unit>
A task that represents the asynchronous update operation. The task result contains the updated Unit, or
nullif the unit was not found.
UpdateUnitMasterList(UpdateUnitIdListDto)
Updates the unit master list based on the provided unit identifiers. Returns the updated Unit when the operation succeeds, or null when no matching unit is found.
Task<Unit?> UpdateUnitMasterList(UpdateUnitIdListDto updateUnitListDto)
Parameters
updateUnitListDtoUpdateUnitIdListDtoThe data transfer object containing the list of unit identifiers to update.