Details:
- In this below code
_reportData.DistrictID
andreportData.BeneficieryID
values are""
. But filter condition is not working. My requirement is to get matching values from the table. - Below code is not filtering the data.
Below is the code to retrieve filtered data
public async Task<IEnumerable<BeneficieryMasterExcelUpload>> GetBeneficieryReports(ReportsDataSearch _reportData)
{
IEnumerable<BeneficieryMasterExcelUpload> beneficieryList = _appDBContext.BeneficieryMasterExcelUpload;
try
{
var beneficieryList = (from b in _appDBContext.BeneficieryMasterExcelUpload
where b.Financial_Year.Contains(_reportData.FinancialYear)
|| b.District.Contains(_reportData.DistrictID) ||
b.Name.Contains(_reportData.BeneficieryID) ||
b.District.Contains(_reportData.DistrictID) ||
b.Taluk.Contains(_reportData.TalukID) ||
b.Village.StartsWith(_reportData.VillageID) ||
b.SchemeName.Contains(_reportData.SchemeMasterID)
select new BeneficieryMasterExcelUpload()
{
BeneficieryID = b.BeneficieryID,
Name = b.Name,
SchemeName = b.SchemeName,
BusinessName = b.BusinessName,
District = b.District,
Taluk = b.Taluk,
Village = b.Village,
Constitunency_num = b.Constitunency_num,
BankName = b.BankName,
Financial_Year = b.Financial_Year,
Religion = b.Religion,
}).ToList();
return beneficieryList;
}
catch (Exception ex)
{
return null;
}