[Solved] Get object in LINQ expression
[ad_1] You could try collecting every db entry that matches your criteria first public static IEnumerable<string> GetFiles(List<string> srcFiles) { var filePaths = new List<string>(); using (var db = new ContentMgmtContext()) { foreach (var fileInfo in srcFiles.Select(file => new FileInfo(file))) { var matches = db.Files.Where(o => o.FileName.ToLower() == fileInfo.Name.ToLower() || o.FileSize == fileInfo.Length.ToString()) if (matches.Count() > … Read more