resharper 让我将其设为局部变量,并写道“访问修改后的闭包”
if (filter != null)
{
if (filter.CityId != 0)
{
ads = ads.Where(x => x.Ad.CityId == filter.CityId);
}
if (filter.BusinesCategoryId != 0)
{
ads = ads.Where(x => x.BusinessCategoryId == filter.BusinesCategoryId);
}
}
为什么要做局部变量过滤?