Interface IMasterListService<T>
- Namespace
- adas_core.Application.Services.Interfaces
- Assembly
- adas-core.Application.dll
public interface IMasterListService<T> where T : MasterList
Type Parameters
T
- Extension Methods
Methods
AddOptionToMasterList(ObjectId, FilterOptionListElement)
Adds the specified option element to the master option list identified by the given identifier.
Task<OptionList?> AddOptionToMasterList(ObjectId id, FilterOptionListElement opt)
Parameters
idObjectIdThe unique identifier of the master option list to which the option will be added.
optFilterOptionListElementThe filter option list element to append to the master list.
Returns
- Task<OptionList>
A task that returns the updated OptionList, or
nullif the master list could not be found.
DeleteMasterListById(ObjectId)
Deletes a master list identified by the specified identifier.
Task DeleteMasterListById(ObjectId id)
Parameters
idObjectIdThe unique identifier of the master list to delete.
Returns
DeleteMasterListOption(ObjectId, ObjectId, string)
Asynchronously deletes a master list option identified by the supplied identifiers.
Task<bool> DeleteMasterListOption(ObjectId id, ObjectId optId, string typeName)
Parameters
idObjectIdThe identifier of the master list that contains the option to delete.
optIdObjectIdThe identifier of the specific option to remove from the master list.
typeNamestringThe name of the master list type to which the option belongs.
Returns
FindOptionItemById(ObjectId, ObjectId, LocaleEnum)
Asynchronously retrieves an option list item identified by the specified master ID, option ID, and locale.
Task<OptionList?> FindOptionItemById(ObjectId masterId, ObjectId optionId, LocaleEnum locale)
Parameters
masterIdObjectIdThe identifier of the master entity that owns the option list.
optionIdObjectIdThe identifier of the specific option item to find.
localeLocaleEnumThe locale used to retrieve the localized option item.
Returns
- Task<OptionList>
A task that represents the asynchronous operation, containing the matching OptionList or
nullif no item is found.
GetAllMasterList()
Asynchronously retrieves the complete master list of items of type T.
Task<IEnumerable<T>> GetAllMasterList()
Returns
- Task<IEnumerable<T>>
A task that represents the asynchronous operation. The task result contains an IEnumerable<T> with all items from the master list.
GetAllMasterListCount()
Asynchronously retrieves the total count of all items in the master list.
Task<int> GetAllMasterListCount()
Returns
- Task<int>
A task that represents the asynchronous operation. The task result contains the total number of items in the master list.
GetAllMasterListWithPaginatedOptions(PaginationFilter)
Retrieves a paginated collection of master list items with their associated options based on the specified pagination filter.
Task<IEnumerable<MasterListWithPaginatedOptionsDto>> GetAllMasterListWithPaginatedOptions(PaginationFilter request)
Parameters
requestPaginationFilterThe pagination filter containing paging criteria such as page number and page size.
Returns
- Task<IEnumerable<MasterListWithPaginatedOptionsDto>>
A task that represents the asynchronous operation, containing an enumerable collection of MasterListWithPaginatedOptionsDto items for the requested page.
GetAllMasterListWithoutOptions()
Retrieves all master list entries, excluding items categorized as options.
Task<IEnumerable<MasterListDto>> GetAllMasterListWithoutOptions()
Returns
- Task<IEnumerable<MasterListDto>>
A task that represents the asynchronous operation. The task result contains a collection of MasterListDto items representing the master list without options.
GetAssociatedList(ObjectId, MasterListType, MasterListType)
Retrieves the associated list identifier for the given object based on the specified master list types.
Task<ObjectId?> GetAssociatedList(ObjectId id, MasterListType masterListType1, MasterListType masterListType2)
Parameters
idObjectIdThe identifier of the object whose associated list is being requested.
masterListType1MasterListTypeThe first master list type used to determine the association.
masterListType2MasterListTypeThe second master list type used to determine the association.
Returns
- Task<ObjectId?>
A task that returns the associated MongoDB.Bson.ObjectId if found, or
nullif no association exists.
GetMasterListById(ObjectId, LocaleEnum?)
Retrieves a master list entry identified by the specified id, optionally resolving localized content based on the provided locale. Returns null when no matching entry is found.
Task<T?> GetMasterListById(ObjectId id, LocaleEnum? locale)
Parameters
idObjectIdThe unique identifier of the master list entry to retrieve.
localeLocaleEnum?The optional locale used to resolve localized fields; when
null, a default or non-localized representation is returned.
Returns
- Task<T>
A task that resolves to the matching master list entry of type
T, ornullif the entry does not exist.
GetMasterListByIdAndSearchOptions(ObjectId, FilterOptionListElement)
Asynchronously retrieves a master list of options associated with the specified identifier, applying the provided search and filter criteria.
Task<List<OptionList>> GetMasterListByIdAndSearchOptions(ObjectId id, FilterOptionListElement filterOption)
Parameters
idObjectIdThe identifier used to locate the master list to retrieve.
filterOptionFilterOptionListElementThe filter and search options used to refine the returned list.
Returns
- Task<List<OptionList>>
A task that represents the asynchronous operation, containing the list of OptionList entries that match the specified id and filter options.
GetMasterListByIdAndTextSearch(ObjectId, string?)
Retrieves a master list of OptionList entries filtered by the specified identifier and an optional text search criterion.
Task<List<OptionList>> GetMasterListByIdAndTextSearch(ObjectId id, string? textSearch)
Parameters
idObjectIdThe unique identifier used to scope the master list lookup.
textSearchstringAn optional text string used to further filter the results; may be
nullto return all matching entries.
Returns
- Task<List<OptionList>>
A task that represents the asynchronous operation, containing a list of OptionList items matching the provided identifier and text search.
GetMasterListByIdWithPaginatedOptions(ObjectId, PaginationFilter)
Asynchronously retrieves a master list along with its paginated options identified by the specified id. Returns null when no master list is found for the given identifier.
Task<MasterListWithPaginatedOptionsDto?> GetMasterListByIdWithPaginatedOptions(ObjectId id, PaginationFilter request)
Parameters
idObjectIdThe unique identifier of the master list to retrieve.
requestPaginationFilterThe pagination filter used to control the paginated options returned with the master list.
Returns
- Task<MasterListWithPaginatedOptionsDto>
A task that represents the asynchronous operation. The task result contains the MasterListWithPaginatedOptionsDto if a matching master list is found, otherwise null.
GetMasterListByName(string)
Asynchronously retrieves a master list that matches the specified name.
Task<T?> GetMasterListByName(string name)
Parameters
namestringThe name used to look up the master list.
Returns
- Task<T>
A task that represents the asynchronous operation. The result is the matching master list of type
T, ornullif no master list with the specified name is found.
GetMasterListOptionsNamesById(ObjectId)
Retrieves the list of master list option names associated with the specified identifier.
Task<List<string>> GetMasterListOptionsNamesById(ObjectId id)
Parameters
idObjectIdThe unique identifier of the master list whose option names are being retrieved.
Returns
- Task<List<string>>
A task that represents the asynchronous operation, containing a list of option names for the specified master list.
GetOptionsOfList(ObjectId)
Retrieves the available options associated with the specified list identifier.
Task<List<string>> GetOptionsOfList(ObjectId id)
Parameters
idObjectIdThe unique identifier of the list whose options are being retrieved.
Returns
- Task<List<string>>
A task that represents the asynchronous operation, containing a list of option strings for the specified list.
GetPaginatedMasterList(PaginationFilter)
Retrieves a paginated master list of items based on the specified filter criteria.
Task<PaginationResponse<T>> GetPaginatedMasterList(PaginationFilter filter)
Parameters
filterPaginationFilterThe pagination filter that defines paging parameters such as page number and page size.
Returns
- Task<PaginationResponse<T>>
A task that represents the asynchronous operation, containing the paginated response with the requested master list items.
GetPaginatedMasterListWithPaginatedOptions(PaginationFilter, PaginationFilter)
Asynchronously retrieves a paginated master list along with its associated paginated options.
Task<PaginationResponse<MasterListWithPaginatedOptionsDto>> GetPaginatedMasterListWithPaginatedOptions(PaginationFilter listFilter, PaginationFilter optionsFilter)
Parameters
listFilterPaginationFilterThe pagination filter applied to the master list results.
optionsFilterPaginationFilterThe pagination filter applied to the associated options.
Returns
- Task<PaginationResponse<MasterListWithPaginatedOptionsDto>>
A task that represents the asynchronous operation, containing the paginated response with master list and options data.
GetPaginatedOptions(PaginationFilter, ObjectId)
Retrieves a paginated collection of options associated with the specified list.
Task<PaginationResponse<OptionList>> GetPaginatedOptions(PaginationFilter filter, ObjectId listId)
Parameters
filterPaginationFilterThe pagination parameters used to control the page size and page index of the returned results.
listIdObjectIdThe identifier of the list whose options should be retrieved.
Returns
- Task<PaginationResponse<OptionList>>
A task that represents the asynchronous operation, containing a PaginationResponse<T> with the requested options.
InsertMasterList(T)
Inserts the specified item into the master list and returns the resulting entry, or null if the operation did not produce a result.
Task<T?> InsertMasterList(T item)
Parameters
itemTThe item to insert into the master list.
Returns
- Task<T>
A Task<TResult> that resolves to the inserted item, or
nullwhen no result is available.
RemoveMasterListOption(ObjectId, OptionList)
Asynchronously removes the specified option from the master list identified by the given id.
Task<bool> RemoveMasterListOption(ObjectId id, OptionList oldOpt)
Parameters
idObjectIdThe identifier of the master list from which the option will be removed.
oldOptOptionListThe option entry to be removed from the master list.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result is
trueif the option was successfully removed; otherwise,false.
UpdateFullMasterListOption(ObjectId, OptionList, string)
Updates the full master list option identified by the specified identifier and type name.
Task<OptionList?> UpdateFullMasterListOption(ObjectId id, OptionList opt, string typeName)
Parameters
idObjectIdThe identifier of the option to update.
optOptionListThe option list containing the updated values.
typeNamestringThe name of the type associated with the master list option.
Returns
- Task<OptionList>
A task that represents the asynchronous operation. The task result contains the updated OptionList, or
nullif the option was not found.
UpdateMasterList(T)
Updates the master list with the specified item.
Task<T?> UpdateMasterList(T item)
Parameters
itemTThe item to be updated in the master list.
Returns
- Task<T>
A task that represents the asynchronous update operation, containing the updated item or
nullif the update could not be performed.
UpdateMasterListDescription(ObjectId, string)
Updates the description (name) of a master list entry identified by the specified identifier.
Task<bool> UpdateMasterListDescription(ObjectId id, string name)
Parameters
idObjectIdThe unique identifier of the master list entry to update.
namestringThe new description to apply to the master list entry.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result is
trueif 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 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 successfully updated; otherwise,false.
UpdateMasterListOption(ObjectId, OptionList, string)
Updates a master list option for the specified type with the provided option data.
Task<OptionList?> UpdateMasterListOption(ObjectId id, OptionList opt, string typeName)
Parameters
idObjectIdThe unique identifier of the option to update.
optOptionListThe option data to apply to the master list.
typeNamestringThe name of the master list type containing the option.
Returns
- Task<OptionList>
The updated OptionList, or null if the option is not found.
UpdateMasterListOption(ObjectId, OptionList, string, LocaleEnum)
Updates an option in a master list, localized for the specified locale, and returns the updated option list.
Task<OptionList?> UpdateMasterListOption(ObjectId id, OptionList opt, string typeName, LocaleEnum locale)
Parameters
idObjectIdThe identifier of the option to update.
optOptionListThe option data to apply to the existing entry.
typeNamestringThe name of the master list type that owns the option.
localeLocaleEnumThe locale used to resolve or apply localized values.
Returns
- Task<OptionList>
A task that returns the updated OptionList, or
nullif the option could not be found.
UpdateOptionDetailsToMasterList(ObjectId, UpdateMasterListDetailsDto)
Updates the option details of a master list entry identified by the specified id.
Task<UpdateMasterListDetailsDto?> UpdateOptionDetailsToMasterList(ObjectId id, UpdateMasterListDetailsDto opt)
Parameters
idObjectIdThe identifier of the master list entry to update.
optUpdateMasterListDetailsDtoThe master list details to apply to the entry.
Returns
- Task<UpdateMasterListDetailsDto>
A task that returns the updated master list details, or null if no matching entry is found.