Interface IMasterListRepository<T>
- Namespace
- adas_core.Application.Repositories.Interfaces
- Assembly
- adas-core.Application.dll
public interface IMasterListRepository<T> : IMongoRepository<T> where T : MasterList
Type Parameters
T
- Inherited Members
- Extension Methods
Methods
AddOptionToMasterList(ObjectId, FilterOptionListElement)
Asynchronously adds a FilterOptionListElement to the master option list identified by the given MongoDB.Bson.ObjectId.
Task<OptionList?> AddOptionToMasterList(ObjectId id, FilterOptionListElement opt)
Parameters
idObjectIdThe identifier of the master option list to which the element will be added.
optFilterOptionListElementThe filter option list element to add to the master list.
Returns
- Task<OptionList>
A task that represents the asynchronous operation. The task result contains the resulting OptionList, or
nullif no list is returned.
Count()
Asynchronously counts the number of items and returns the total.
Task<int> Count()
Returns
- Task<int>
A task that represents the asynchronous operation. The task result contains the total count of items.
Delete(ObjectId)
Deletes the entity identified by the specified identifier.
Task Delete(ObjectId id)
Parameters
idObjectIdThe identifier of the entity to delete.
Returns
DeleteMasterListOption(ObjectId, ObjectId)
Deletes a master list option identified by the specified option ID.
Task<bool> DeleteMasterListOption(ObjectId id, ObjectId deleteOptId)
Parameters
idObjectIdThe identifier of the master list containing the option to delete.
deleteOptIdObjectIdThe identifier of the option to be deleted from the master list.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating whether the option was successfully deleted.
FindById(ObjectId)
Asynchronously retrieves an entity of type T by its unique identifier.
Returns null when no matching entity is found.
Task<T?> FindById(ObjectId id)
Parameters
idObjectIdThe unique identifier of the entity to locate.
Returns
- Task<T>
A task that represents the asynchronous operation. The task result contains the entity of type
Tif found, ornullotherwise.
FindById(ObjectId, LocaleEnum?)
Asynchronously retrieves an entity identified by the specified id, optionally resolving localized content using the given locale. Returns null when no matching entity is found.
Task<T?> FindById(ObjectId id, LocaleEnum? locale)
Parameters
idObjectIdThe unique identifier of the entity to look up.
localeLocaleEnum?The optional locale used to resolve localized fields of the retrieved entity.
Returns
- Task<T>
A task that yields the matching entity, or
nullif the entity is not found.
FindByName(string)
Asynchronously finds and returns an entity of type T matching the specified name.
Returns null when no matching entity is found.
Task<T?> FindByName(string name)
Parameters
namestringThe name used to look up the entity.
Returns
- Task<T>
A task that represents the asynchronous lookup, containing the matched entity of type
Tornullif no match exists.
FindOptionItemById(ObjectId, ObjectId)
Asynchronously retrieves an OptionList identified by the given master and option identifiers.
Task<OptionList?> FindOptionItemById(ObjectId masterId, ObjectId optionId)
Parameters
masterIdObjectIdThe identifier of the master record that owns the option list.
optionIdObjectIdThe identifier of the specific option item to locate within the master.
Returns
- Task<OptionList>
A Task<TResult> that yields the matching OptionList, or
nullwhen no item is found.
FindOptionItemById(ObjectId, ObjectId, LocaleEnum)
Asynchronously retrieves an OptionList item identified by the specified master and option identifiers for the given locale.
Returns null when no matching option item is found for the provided identifiers and locale.
Task<OptionList?> FindOptionItemById(ObjectId masterId, ObjectId optionId, LocaleEnum locale)
Parameters
masterIdObjectIdThe master identifier used to scope the lookup of the option item.
optionIdObjectIdThe identifier of the specific option item to retrieve within the master scope.
localeLocaleEnumThe locale used to select the localized version of the option item.
Returns
- Task<OptionList>
A Task<TResult> that yields the matching OptionList, or
nullif no item is found.
GetAll()
Asynchronously retrieves all items of type T.
Task<IEnumerable<T>> GetAll()
Returns
- Task<IEnumerable<T>>
A task that represents the asynchronous operation. The task result contains an enumerable collection of all items of type T.
GetAllWithoutOptions()
Retrieves all master list entries without applying optional filters or including related option data. Used to fetch the complete set of master list records for scenarios such as full enumeration or bulk operations.
Task<IEnumerable<MasterListDto>> GetAllWithoutOptions()
Returns
- Task<IEnumerable<MasterListDto>>
A task that represents the asynchronous operation, containing an IEnumerable<T> with all available master list entries.
GetMasterListByIdAndSearchOptions(ObjectId, FilterOptionListElement?)
Retrieves a master list of OptionList entries identified by the given id, optionally applying the provided search and filtering options.
Task<List<OptionList>> GetMasterListByIdAndSearchOptions(ObjectId id, FilterOptionListElement? filterOption)
Parameters
idObjectIdThe identifier of the master list to retrieve.
filterOptionFilterOptionListElementOptional filter criteria used to narrow the returned options. May be
nullto return the full list without additional filtering.
Returns
- Task<List<OptionList>>
A task that represents the asynchronous operation, containing the list of OptionList items that match the specified id and filter, or an empty list if no matching entries are found.
GetMasterListByIdAndTextSearchContaining(ObjectId, string?)
Retrieves a master list of option list entries filtered by the specified identifier and an optional text search that performs a contains match.
Task<List<OptionList>> GetMasterListByIdAndTextSearchContaining(ObjectId id, string? textSearch)
Parameters
idObjectIdThe identifier used to scope the option list entries to be returned.
textSearchstringAn optional text used to filter entries whose content contains the specified value; may be null to skip text-based filtering.
Returns
- Task<List<OptionList>>
A task representing the asynchronous operation, containing a list of OptionList entries that match the identifier and the optional text search criteria.
GetPaginatedMasterList(PaginationFilter)
Retrieves a paginated master list using the specified pagination filter, returning a fluent queryable result.
IFindFluent<T, T> GetPaginatedMasterList(PaginationFilter filter)
Parameters
filterPaginationFilterThe pagination filter that defines the paging criteria applied to the master list query.
Returns
- IFindFluent<T, T>
An MongoDB.Driver.IFindFluent<TDocument, TProjection> that represents the paginated queryable master list.
GetPaginatedOptions(PaginationFilter, ObjectId)
Retrieves a paginated collection of options associated with the specified list identifier, applying the provided pagination filter to control the result set.
Task<List<OptionList>> GetPaginatedOptions(PaginationFilter filter, ObjectId listId)
Parameters
filterPaginationFilterThe pagination filter defining page size, page number, and related pagination constraints.
listIdObjectIdThe unique identifier of the list whose options should be retrieved.
Returns
- Task<List<OptionList>>
A task representing the asynchronous operation, containing a list of OptionList items for the requested page.
RemoveMasterListOption(ObjectId, OptionList)
Asynchronously removes the specified option from the master list associated with the given identifier.
Task<bool> RemoveMasterListOption(ObjectId id, OptionList oldOpt)
Parameters
idObjectIdThe identifier of the master list from which the option will be removed.
oldOptOptionListThe option to be removed from the master list.
Returns
- Task<bool>
A task that represents the asynchronous removal operation. The task result contains true if the option was successfully removed; otherwise, false.
Update(T)
Asynchronously updates the specified collection of items.
Task Update(T list)
Parameters
listTThe collection of items to update.
Returns
UpdateFullMasterListOption(ObjectId, OptionList)
Updates an existing master list option identified by the given id with the provided data, returning the updated option or null if no matching option is found.
Task<OptionList?> UpdateFullMasterListOption(ObjectId id, OptionList newOpt)
Parameters
idObjectIdThe unique identifier of the master list option to update.
newOptOptionListThe new option data to replace the existing master list option.
Returns
- Task<OptionList>
A task representing the asynchronous operation, containing the updated OptionList, or null if no option with the specified id exists.
UpdateMasterListDescription(ObjectId, string)
Asynchronously updates the description of a master list identified by the specified identifier.
Task<bool> UpdateMasterListDescription(ObjectId id, string description)
Parameters
idObjectIdThe unique identifier of the master list to update.
descriptionstringThe new description to set for the master list.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result is true if the update was successful; otherwise, false.
UpdateMasterListName(ObjectId, string)
Updates the name of an existing master list identified by the specified identifier.
Task<bool> UpdateMasterListName(ObjectId id, string name)
Parameters
idObjectIdThe unique identifier of the master list to update.
namestringThe new name to assign to the master list.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result is
trueif the master list was updated successfully; otherwise,false.
UpdateMasterListOption(ObjectId, OptionList)
Updates an existing master list option identified by the specified id with the provided new option data.
Task<OptionList?> UpdateMasterListOption(ObjectId id, OptionList newOpt)
Parameters
idObjectIdThe unique identifier of the master list option to update.
newOptOptionListThe new option data to apply to the existing master list option.
Returns
- Task<OptionList>
A task that represents the asynchronous operation, containing the updated OptionList, or
nullif no matching option was found.
UpdateMasterListOption(ObjectId, OptionList, LocaleEnum)
Updates an existing master list option identified by the specified identifier using the provided option data and locale, returning the updated option list.
Task<OptionList?> UpdateMasterListOption(ObjectId id, OptionList newOpt, LocaleEnum locale)
Parameters
idObjectIdThe unique identifier of the master list option to update.
newOptOptionListThe new option list data to apply to the master list option.
localeLocaleEnumThe locale used for the update operation.
Returns
- Task<OptionList>
A task that represents the asynchronous operation, containing the updated OptionList if found, or
nullif no matching master list option exists.
UpdateOptionDetailsToMasterList(ObjectId, UpdateMasterListDetailsDto)
Updates the option details of an existing entry in the master list identified by the specified id.
Task<UpdateMasterListDetailsDto?> UpdateOptionDetailsToMasterList(ObjectId id, UpdateMasterListDetailsDto opt)
Parameters
idObjectIdThe unique identifier of the master list entry to update.
optUpdateMasterListDetailsDtoThe update payload containing the new option details to apply.
Returns
- Task<UpdateMasterListDetailsDto>
A task that represents the asynchronous operation, containing the updated master list details, or null if no matching entry is found.