I have migrated my tool from .Net core version 3.1 to 6 and upgrade all the nuget packages accordingly also after migrating I cleaned the solution and build it again. After all these the linq methods (eg. FirstorDefault, SingleorDefault etc) are getting null value from the dbcontext although all were working fine previously. I have checked if dbcontext is getting data or not and it is getting data properly but after querying into it I can not get any data although desired data is present in the datalist.
this is the query which is filtering object from dbset.
Object with highlighted Guid is present in the datalist.
EnvironmentConfigDataLib.Entities.Environments app = _dbContext.Environments
.FirstOrDefault(x => x.EnvironmentId == item.SourceEnvironmentId); //--> this line is getting null although passing guid is present in the DBSet.
The same code is working in .Net Core 3.1 version tool. Does anyone have any idea why this issue is coming?Packages installed
I tried to fetch data from DbSet using Linq and it was coming properly for 3.1 version but for 6.0 version same code is getting null value.