testcase to check item is null or not.
foreach (var fileName in filelist) { var item = await fileInfoContextService.GetFileInfo(projectId, fileName); if (item == null) { await fileInfoContextService.InsertFileInfo(projectId, fileName, FileStatus.NotStarted); } }