Skip to content

Commit 707b955

Browse files
committed
going raw documentation
1 parent d3c5c50 commit 707b955

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

docs/Going-Raw.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
To be written. This section will be about `IAssemblyDataLocator`, `IAssemblyLoader`, etc
1+
In this section, we will cover each of the tools in the package separately so you can customize everything.
2+
3+
# Manually Loading DLLs
4+
It is possible to trigger DLL loads manually by injecting `IAssemblyLoader` and calling `LoadAssemblyByNameAsync`. This will automatically solve all the concurrency problems for you and fetch the DLLs if required using `IAssemblyDataProvider` internally.
5+
6+
# Manually Handling Assembly Downloads
7+
In order to change how the DLL data gets retrieved, you can override the implementation of `IAssemblyDataProvider`. This will give you full control on how to fetch for assemblies. It uses `IAssemblyDataLocator` underneath in case you just want to customize the paths from where the assemblies get downloaded.

src/nuget/BlazorLazyLoading.Server/StartupExtensions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static IServiceCollection AddLazyLoading(
3434
services.AddSingleton<IAssemblyLoadContext, DisposableAssemblyLoadContext>();
3535
}
3636

37-
services.AddSingleton<IAssemblyDataProvider, AssemblyDataProvider>();
37+
services.AddSingleton(typeof(IAssemblyDataProvider), options.AssemblyDataProvider ?? typeof(AssemblyDataProvider));
3838
services.AddSingleton(typeof(IAssemblyDataLocator), options.AssemblyDataLocator ?? typeof(AssemblyDataLocator));
3939

4040
services.AddSingleton<IContentFileReader>(
@@ -96,6 +96,11 @@ public sealed class LazyLoadingOptions
9696
/// </summary>
9797
public bool UseAssemblyIsolation { get; set; } = true;
9898

99+
/// <summary>
100+
/// Configures a custom IAssemblyDataProvider. The type must implement BlazorLazyLoading.Abstractions.IAssemblyDataProvider
101+
/// </summary>
102+
public Type? AssemblyDataProvider { get; set; } = null;
103+
99104
/// <summary>
100105
/// Configures a custom IAssemblyDataLocator. The type must implement BlazorLazyLoading.Abstractions.IAssemblyDataLocator
101106
/// </summary>

src/nuget/BlazorLazyLoading.Wasm/StartupExtensions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public static IServiceCollection AddLazyLoading(
2222
services.AddSingleton<IAssemblyLoader>(CreateAssemblyLoader);
2323
services.AddSingleton<IAssemblyLoadContext, AppDomainAssemblyLoadContext>();
2424
services.AddSingleton(typeof(IAssemblyDataLocator), options.AssemblyDataLocator ?? typeof(AssemblyDataLocator));
25+
services.AddSingleton(typeof(IAssemblyDataProvider), options.AssemblyDataProvider ?? typeof(AssemblyDataProvider));
2526
services.AddSingleton<IContentFileReader, NetworkContentFileReader>();
26-
services.AddSingleton<IAssemblyDataProvider, AssemblyDataProvider>();
2727

2828
services.AddSingleton(typeof(IManifestLocator), options.ManifestLocator ?? typeof(ManifestLocator));
2929
services.AddSingleton<IManifestRepository, ManifestRepository>();
@@ -53,6 +53,11 @@ public sealed class LazyLoadingOptions
5353
/// </summary>
5454
public IEnumerable<string> ModuleHints { get; set; } = Array.Empty<string>();
5555

56+
/// <summary>
57+
/// Configures a custom IAssemblyDataProvider. The type must implement BlazorLazyLoading.Abstractions.IAssemblyDataProvider
58+
/// </summary>
59+
public Type? AssemblyDataProvider { get; set; } = null;
60+
5661
/// <summary>
5762
/// Configures a custom IAssemblyDataLocator. The type must implement BlazorLazyLoading.Abstractions.IAssemblyDataLocator
5863
/// </summary>

0 commit comments

Comments
 (0)