how can I
Opened this issue · 0 comments
nellyigiebor commented
Hi,
How can use a where clause inside for include ?? I want the included table to be filtered with a value.
example :-
var results = await _unitOfWork.GetRepository().GetPagedListAsync(
b => new CompanySearchResultDto
{
Id = b.Id,
Name = b.Name,
AccountRefNo = b.AccountRefNo,
CompanyLogo = b.CompanyLogo,
CountryName = b.Country.Name,
CityName = b.City.Name,
DistrictName = b.District.Name,
Neighborhood = b.Neighborhood,
StoreCount = b.CompanyStores.Count(q => q.IsDeleted == false)
},
include: source=>source.Include(w =>w.CompanyAgenda.Where( t=> t.Status !== RecordState.DELETE )),
predicate: p => p.Id.Equals(Id),
pageIndex: pageIndex, pageSize: pageSize
);
Thanks in advance
Look forward to hearing from you.