Changed select to project while getting service list API
This commit is contained in:
parent
bb01e645fe
commit
910110f86d
@ -1,4 +1,5 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
|
using AutoMapper.QueryableExtensions;
|
||||||
using Marco.Pms.DataAccess.Data;
|
using Marco.Pms.DataAccess.Data;
|
||||||
using Marco.Pms.Helpers.Utility;
|
using Marco.Pms.Helpers.Utility;
|
||||||
using Marco.Pms.Model.Collection;
|
using Marco.Pms.Model.Collection;
|
||||||
@ -520,7 +521,7 @@ namespace Marco.Pms.Services.Service
|
|||||||
// Step 1: Fetch services for the tenant
|
// Step 1: Fetch services for the tenant
|
||||||
var services = await _context.ServiceMasters
|
var services = await _context.ServiceMasters
|
||||||
.Where(s => s.TenantId == tenantId && s.IsActive)
|
.Where(s => s.TenantId == tenantId && s.IsActive)
|
||||||
.Select(s => _mapper.Map<ServiceMasterVM>(s))
|
.ProjectTo<ServiceMasterVM>(_mapper.ConfigurationProvider)
|
||||||
.OrderBy(s => s.Name)
|
.OrderBy(s => s.Name)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user