|
1 | 1 | # Hyperbee.Resources |
2 | 2 |
|
3 | | -Provides a dependency injection pattern for embedded resources |
| 3 | +## Usage |
| 4 | + |
| 5 | +Implement IResourceLocator and set the implementation's namespace to your resource location. |
| 6 | + |
| 7 | +Inject IResourceProvider<Implementation> to use. |
| 8 | + |
| 9 | + |
| 10 | +**For example:** |
| 11 | + |
| 12 | + |
| 13 | +*this gives the path to the resources* |
| 14 | + |
| 15 | + `public class MyResourceLocator : IResourceLocator |
| 16 | + { |
| 17 | + public string Namespace => typeof(MyResourceLocator).Namespace; |
| 18 | + }` |
| 19 | + |
| 20 | + *register the provider* |
| 21 | + |
| 22 | +* `services.AddTransient<IResourceProvider<MyResourceLocator>>();` |
| 23 | +* `var locator = services.GetService<IResourceProvider<MyResourceLocator>>();` |
| 24 | +* `var resource = ResourceHelper.GetResource( locator, "resourceName" ); ` |
| 25 | + |
4 | 26 |
|
5 | 27 |
|
6 | 28 | # Build Requirements |
7 | 29 |
|
8 | 30 | * To build and run this project, **.NET 9 SDK** is required. |
9 | | -* Ensure your development tools are compatible with .NET 9. |
| 31 | +* Ensure your development tools are compatible with .NET 8 or higher. |
10 | 32 |
|
11 | 33 | ## Building the Project |
12 | 34 |
|
13 | | -* With .NET 8 SDK installed, you can build the project using the standard `dotnet build` command. |
| 35 | +* With .NET 9 SDK installed, you can build the project using the standard `dotnet build` command. |
14 | 36 |
|
15 | 37 | ## Running Tests |
16 | 38 |
|
17 | 39 | * Run tests using the `dotnet test` command as usual. |
18 | 40 |
|
| 41 | + |
19 | 42 | # Status |
20 | 43 |
|
21 | 44 | | Branch | Action | |
22 | 45 | |------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
23 | | -| `develop` | [](https://github.com/Stillpoint-Software/Hyperbee.Resources/actions/workflows/publish.yml) | |
24 | | -| `main` | [](https://github.com/Stillpoint-Software/Hyperbee.Resources/actions/workflows/publish.yml) | |
| 46 | +| `develop` | [](https://github.com/Stillpoint-Software/hyperbee.resources/actions/workflows/publish.yml) | |
| 47 | +| `main` | [](https://github.com/Stillpoint-Software/hyperbee.resources/actions/workflows/publish.yml) | |
25 | 48 |
|
26 | 49 |
|
27 | | -# Help |
| 50 | +# Benchmarks |
| 51 | + See [Benchmarks](https://github.com/Stillpoint-Software/Hyperbee.Resources/test/Hyperbee.Resources.Benchmark/benchmark/results/Hyperbee.Resources.Benchmark.ResourcesBenchmark-report-github.md) |
| 52 | + |
28 | 53 |
|
29 | | -See [Todo](https://github.com/Stillpoint-Software/Hyperbee.Resources/blob/main/docs/todo.md) |
| 54 | +# Help |
30 | 55 |
|
| 56 | +See [Todo](https://github.com/Stillpoint-Software/hyperbee.resources/blob/main/docs/todo.md) |
31 | 57 |
|
32 | | -[](https://github.com/Stillpoint-Software/Hyperbee.Resources) |
| 58 | +[](https://github.com/Stillpoint-Software/Hyperbee.Resources) |
0 commit comments