0
下面的函数返回文件表中的所有行,即使如果应用,其中过滤器,LINQ搜索查询
public IList<File> SearchFiles(int? FileID, int? type, int? Status)
{
var files = from fil in _context.Files
select fil;
if (FileID != null)
{
files.Where(x => x.FileID == FileID);
}
if (type != null)
{
files.Where(x => x.FileTypeID == type);
}
if (Status != null)
{
files.Where(x => x.FileStatusID == Status);
}
return files.ToList<File>();
}
任何错误我在做什么吗?
在此先感谢!