public static void DeleteRange(this RepositoryHost repositoryHost, RepositoryPath[] paths) { var files = paths.SelectMany(item => item.GetFiles()).ToArray(); foreach (var item in files) { if (File.Exists(item) == false) { throw new FileNotFoundException(); } } repositoryHost.DeleteRange(files); }
public static void Delete(this RepositoryHost repositoryHost, RepositoryPath path) { if (path.IsDirectory == true) { repositoryHost.Delete(path.Path); } else { var files = path.GetFiles(); foreach (var item in files) { if (File.Exists(item) == false) { throw new FileNotFoundException(); } } repositoryHost.DeleteRange(files); } }