private void DeleteOrphanPhotos(IEnumerable <HomePagePhotoViewModel> photos) { Func <string, bool> func = p => photos.Any(m => Path.GetFileName(m.PhotoPath) == Path.GetFileName(p)); homePageService.DeleteOrphanPhotos(func); }