public static void PurgeFile(this IFileObject file, bool disposeObject, TimeSpan span) { if (file.CreationTimeUtc != null && file.CreationTimeUtc.Value.AddDays(span.TotalDays) > DateTime.UtcNow) { file.DeleteFile(disposeObject); DependencyResolver.GetInstance <ILogger>().ConsoleAndLog($"Purging File : {file.FullFilePath} -> {file.GetFileSizeDisplay()} b"); } }