Implement IResourceLocator and set the implementation's namespace to your resource location.
Inject IResourceProvider to use.
For example:
this gives the path to the resources
public class MyResourceLocator : IResourceLocator { public string Namespace => typeof(MyResourceLocator).Namespace; }
register the provider
services.AddTransient<IResourceProvider<MyResourceLocator>>();var locator = services.GetService<IResourceProvider<MyResourceLocator>>();var resource = ResourceHelper.GetResource( locator, "resourceName" );
- To build and run this project, .NET 9 SDK is required.
- Ensure your development tools are compatible with .NET 8 or higher.
- With .NET 9 SDK installed, you can build the project using the standard
dotnet buildcommand.
- Run tests using the
dotnet testcommand as usual.
| Branch | Action |
|---|---|
develop |
|
main |
See Benchmarks
See Todo