Implemented an API to retrieve a list of organizations provided in the contacts. #64
Collaborator
- It gets the current tenant ID using _userHelper.GetTenantId() and fetches the logged-in employee details using _userHelper.GetCurrentEmployeeAsync().
- It queries the Contacts table, filtering contacts by the current tenant ID.
- It selects only the organization field and applies .Distinct() to eliminate duplicates.
- The result is materialized into a list with ToListAsync().
- A log entry is written indicating which employee fetched the data for which tenant.
- Finally, it returns a successful API response containing the list of unique organization names and a message showing how many were found.
1. It gets the current tenant ID using _userHelper.GetTenantId() and fetches the logged-in employee details using _userHelper.GetCurrentEmployeeAsync().
2. It queries the Contacts table, filtering contacts by the current tenant ID.
3. It selects only the organization field and applies .Distinct() to eliminate duplicates.
4. The result is materialized into a list with ToListAsync().
5. A log entry is written indicating which employee fetched the data for which tenant.
6. Finally, it returns a successful API response containing the list of unique organization names and a message showing how many were found.
ashutosh.nehete
added 1 commit 2025-05-21 04:59:15 +00:00
Merge pull request 'Implemented an API to retrieve a list of organizations provided in the contacts.' (#64) from Ashutosh_Task#317_Get_Organization_List into Feature_Directory
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "Ashutosh_Task#317_Get_Organization_List"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?