public static IServiceCollection AddLocalFsStorage(this IServiceCollection services, LocalFsStorageConfiguration storageConfiguration) { var storageInfo = new LocalStorageInfo(storageConfiguration.Path); services.AddSingleton <LocalStorageInfo>(storageInfo); services.AddSingleton <IStorage <LocalStorageInfo>, LocalStorage <LocalStorageInfo> >(); return(services); }
internal static FileInfo ToFileInfo(this System.IO.FileInfo info, LocalStorageInfo storageInfo) { var relaivePath = info.FullName.Replace(storageInfo.StoragePath, "").EscapePath().StripPath(); return(new FileInfo(relaivePath, info.Length, info.CreationTimeUtc)); }