GetImages(this IWebHostEnvironment hosting, string relativeDirPath) { var path = hosting.GetFullPath(relativeDirPath); var names = Directory.GetFiles(path) .Where(s => s.EndsWith(".svg") || s.EndsWith(".png")) .Select(s => { var fileName = Path.GetFileName(s); var relativePath = Path.Combine(relativeDirPath, fileName); return(relativePath.AsHtmPath(), Path.GetFileNameWithoutExtension(fileName)); }); return(names); }
public static string GetImageInfo(this IWebHostEnvironment hosting, string relativePath) => hosting.GetFullPath(relativePath);