|
@@ -23,6 +23,7 @@ using MTWorkHR.Infrastructure.EmailService;
|
|
|
using Countries.NET.Database;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
using System.Collections;
|
|
|
+using System.Linq;
|
|
|
|
|
|
namespace MTWorkHR.Application.Services
|
|
|
{
|
|
@@ -164,6 +165,8 @@ namespace MTWorkHR.Application.Services
|
|
|
//}
|
|
|
public virtual async Task<PagingResultDto<UserAllDto>> GetAll(UserPagingInputDto PagingInputDto)
|
|
|
{
|
|
|
+ var companies = await _unitOfWork.Company.GetAllAsync();
|
|
|
+
|
|
|
var query = _userManager.Users
|
|
|
.Include(u => u.Qualification)
|
|
|
.Include(u => u.JobTitle)
|
|
@@ -225,6 +228,16 @@ namespace MTWorkHR.Application.Services
|
|
|
|
|
|
var list = MapperObject.Mapper.Map<IList<UserAllDto>>(result);
|
|
|
|
|
|
+ var ss = list
|
|
|
+ .Join(companies.Item1, // Join the list with companies.Item1
|
|
|
+ u => u.CompanyId, // Key selector for User (CompanyId)
|
|
|
+ c => c.Id, // Key selector for Company (Id)
|
|
|
+ (u, c) => { // Project the join result
|
|
|
+ u.CompanyName = c.CompanyName; // Assuming 'Name' is the CompanyName in Company entity
|
|
|
+ return u; // Return the updated UserAllDto with CompanyName filled
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
+
|
|
|
return new PagingResultDto<UserAllDto> { Result = list, Total = total };
|
|
|
}
|
|
|
public async Task<List<UserDto>> GetAllEmployees()
|