Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 5bd4b32
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Mon Mar 7 00:29:26 2022 +0100

    Update stashbox.csproj

commit 73712d6
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Mon Mar 7 00:00:47 2022 +0100

    Update changelog

commit daf5515
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Sun Mar 6 23:18:31 2022 +0100

    Update CHANGELOG.md

commit 5c28d00
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Sun Mar 6 22:34:11 2022 +0100

    Update 114_Unable_to_resolve_IHubContext.cs

commit 4c754b9
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Sun Mar 6 22:33:25 2022 +0100

    Fix for #114

commit 31da8fb
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Thu Mar 3 13:29:36 2022 +0100

    Update docs

commit a705b77
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Thu Mar 3 03:34:52 2022 +0100

    Update docs

commit 9a3d4c6
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Thu Mar 3 03:24:36 2022 +0100

    Update RequestContext.cs

commit 84dcaa7
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Thu Mar 3 03:19:25 2022 +0100

    Update docs

commit efce1da
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Thu Mar 3 03:14:59 2022 +0100

    Update changelog & docs

commit 29a3c6b
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Thu Mar 3 02:43:09 2022 +0100

    Pack readme

commit 1909815
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Thu Mar 3 01:11:52 2022 +0100

    Remove automatic pre-release package deployment to NuGet

commit 1acdd37
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Wed Mar 2 23:50:13 2022 +0100

    Update changelog, add ResolveFactoryOrDefault()

commit 1015495
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Wed Mar 2 17:44:14 2022 +0100

    Ability to exclude instance from dispose tracking in factory delegates

commit 74a99c2
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Tue Mar 1 21:21:09 2022 +0100

    Refactor

commit f0b5559
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Tue Mar 1 20:31:56 2022 +0100

    Refactor

commit fd96834
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Tue Mar 1 02:48:21 2022 +0100

    Enable null-safety

commit adbc669
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Mon Feb 28 18:50:18 2022 +0100

    ServiceRegistration refactor

commit eccbe95
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Mon Feb 28 03:46:12 2022 +0100

    Eliminate MemberwiseClone() usages

commit 44da27d
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Mon Feb 28 01:37:11 2022 +0100

    More tests

commit 799557d
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Mon Feb 28 01:19:16 2022 +0100

    Small refactor

commit b3b6962
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Sun Feb 27 18:36:13 2022 +0100

    Include dev branch in workflows

commit 3159cb5
Author: Peter Csajtai <peter.csajtai@outlook.com>
Date:   Sun Feb 27 18:34:11 2022 +0100

    ValueTuple support & ResolveOrDefault()
  • Loading branch information
z4kn4fein committed Mar 7, 2022
1 parent ae7d094 commit 8c6006c
Show file tree
Hide file tree
Showing 148 changed files with 2,750 additions and 1,397 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: "CodeQL"

on:
push:
branches: [ master, v5 ]
branches: [ master, dev ]
paths-ignore:
- '**.md'
- 'docs/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-macOS-CI.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build on Linux and macOS
on:
push:
branches: [ master, v5 ]
branches: [ master, dev ]
paths-ignore:
- '**.md'
- 'docs/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: SonarCloud Analysis
on:
push:
branches: [ master, v5 ]
branches: [ master, dev ]
paths-ignore:
- '**.md'
- 'docs/**'
Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.0
5.2.0
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v5.2.0] - 2022-03-07
### Fixed
- Unable to resolve IHubContext. [#114](https://github.com/z4kn4fein/stashbox/issues/114)
### Added
- Null-safety by enabling null-state analysis.
- Option to exclude a factory's result from dispose tracking, even if it would be tracked by default. This gives the ability to decide within the factory delegate that the result should be tracked or not.
```cs
.Register<Service>(options => options
.WithFactory<IRequestContext>(requestContext =>
requestContext.ExcludeFromTracking(/* get an existing or instantiate a new service */)
)
);
```
- A new `ResolveFactoryOrDefault()` method that allows `null` results.
- A new `ResolveOrDefault()` method that allows `null` results.
- `ValueTuple<,>` [metadata](https://z4kn4fein.github.io/stashbox/#/advanced/wrappers-resolvers?id=metadata-amp-tuple) support.

### Changed
- `Resolve()` with the `nullResultAllowed` parameter became obsolete, it was replaced by `ResolveOrDefault()`.
- Each `ResolveFactory<>()` method became obsolete as their functionality is equivalent to `Resolve<Func<>>()`.

### Removed
- `nullResultAllowed` parameter of `ResolveFactory()`.

## [v5.1.0] - 2022-02-27
### Changed
- Marked the `.WithRuntimeCircularDependencyTracking()` container configuration option as **Obsolete** in favor of [parameterized factory delegates](https://z4kn4fein.github.io/stashbox/#/usage/advanced-registration?id=consider-this-before-using-the-resolver-parameter-inside-a-factory).
Expand Down Expand Up @@ -201,6 +225,7 @@ The validation was executed only at the expression tree building phase, so an al
- Removed the legacy container extension functionality.
- Removed the support of PCL v259.

[v5.2.0]: https://github.com/z4kn4fein/stashbox/compare/5.1.0...5.2.0
[v5.1.0]: https://github.com/z4kn4fein/stashbox/compare/5.0.1...5.1.0
[v5.0.1]: https://github.com/z4kn4fein/stashbox/compare/5.0.0...5.0.1
[v5.0.0]: https://github.com/z4kn4fein/stashbox/compare/4.1.0...5.0.0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Stashbox is a lightweight, fast, and portable dependency injection framework for

Github (stable) | NuGet (stable) | Fuget (stable) | NuGet (pre-release)
--- | --- | --- | ---
[![Github release](https://img.shields.io/github/release/z4kn4fein/stashbox.svg)](https://github.com/z4kn4fein/stashbox/releases) | [![NuGet Version](https://buildstats.info/nuget/Stashbox)](https://www.nuget.org/packages/Stashbox/) | [![Stashbox on fuget.org](https://www.fuget.org/packages/Stashbox/badge.svg?v=5.0.1)](https://www.fuget.org/packages/Stashbox) | [![Nuget pre-release](https://img.shields.io/nuget/vpre/Stashbox)](https://www.nuget.org/packages/Stashbox/)
[![Github release](https://img.shields.io/github/release/z4kn4fein/stashbox.svg)](https://github.com/z4kn4fein/stashbox/releases) | [![NuGet Version](https://buildstats.info/nuget/Stashbox)](https://www.nuget.org/packages/Stashbox/) | [![Stashbox on fuget.org](https://www.fuget.org/packages/Stashbox/badge.svg?v=5.2.0)](https://www.fuget.org/packages/Stashbox) | [![Nuget pre-release](https://img.shields.io/nuget/vpre/Stashbox)](https://www.nuget.org/packages/Stashbox/)

## Core Attributes
- 🚀 Fast, thread-safe, and lock-free operations.
Expand Down Expand Up @@ -68,4 +68,4 @@ Github (stable) | NuGet (stable) | Fuget (stable) | NuGet (pre-release)

*Powered by [Jetbrains'](https://www.jetbrains.com/?from=Stashbox) [Open Source License](https://www.jetbrains.com/community/opensource/?from=Stashbox)*

[![Jetbrains](https://cdn.rawgit.com/z4kn4fein/stashbox/master/assets/jetbrains.svg)](https://www.jetbrains.com/?from=Stashbox)
[![Jetbrains](https://raw.githubusercontent.com/z4kn4fein/stashbox/master/assets/jetbrains.svg)](https://www.jetbrains.com/?from=Stashbox)
7 changes: 0 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ environment:
secure: z/dKTRVRPmpItPTM/lYdX7dBJk3roDLV98Uj1XzpDqqV868xhHX8dnyKwPAJooUj
build_version: ''

deploy:
- provider: NuGet
api_key:
secure: reeMv8YSGs2hypmjbqAl5z0mxm4QBgHRYsnSwsYUXJZ76begJoSdg51CWGFyBPgt
on:
branch: master

skip_tags: true

skip_commits:
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![logo](assets/images/icon.png)

# Stashbox <small>5.0.1</small>
# Stashbox <small>5.2.0</small>

> A lightweight, fast, and portable .NET DI framework.
Expand Down
22 changes: 13 additions & 9 deletions docs/advanced/wrappers-resolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Stashbox uses so-called *Wrapper* and *Resolver* implementations to handle those
* `EnumerableWrapper`: Used to resolve a collection of services wrapped in one of the collection interfaces that a .NET `Array` implements. (`IEnumerable<>`, `IList<>`, `ICollection<>`, `IReadOnlyList<>`, `IReadOnlyCollection<>`)
* `LazyWrapper`: Used to resolve services [wrapped](advanced/wrappers-resolvers?id=lazy) in `Lazy<>`.
* `FuncWrapper`: Used to resolve services [wrapped](advanced/wrappers-resolvers?id=func) in `Func<>` delegates.
* `MetadataWrapper`: Used to resolve services [wrapped](advanced/wrappers-resolvers?id=metadata-amp-tuple) in `Tuple<>` or `Metadata<>`.
* `KeyValueWrapper`: Used to resolve services [wrapped](advanced/wrappers-resolvers?id=keyvaluepair-amp-readonlykeyvalue) in `KeyValuePair` or `ReadOnlyKeyValue<>`.
* `MetadataWrapper`: Used to resolve services [wrapped](advanced/wrappers-resolvers?id=metadata-amp-tuple) in `ValueTuple<,>`, `Tuple<,>`, or `Metadata<,>`.
* `KeyValueWrapper`: Used to resolve services [wrapped](advanced/wrappers-resolvers?id=keyvaluepair-amp-readonlykeyvalue) in `KeyValuePair<,>` or `ReadOnlyKeyValue<,>`.
* `OptionalValueResolver`: Used to resolve optional parameters.
* `DefaultValueResolver`: Used to resolve default values.
* `ParentContainerResolver`: Used to resolve services that are only registered in one of the parent containers.
Expand Down Expand Up @@ -93,11 +93,11 @@ IJob job = funcOfJob(config["connectionString"], new ConsoleLogger());
<!-- div:left-panel -->
### Metadata & Tuple
With the `.WithMetadata()` registration option, you can attach additional information to a service.
To gather this information, you can request the service wrapped in either `Metadata<,>` or `Tuple<,>`.
To gather this information, you can request the service wrapped in either `Metadata<,>`, `ValueTuple<,>`, or `Tuple<,>`.

`Metadata<,>` is a type from the `Stashbox` package, so you might prefer using `Tuple<,>` if you want to avoid referencing Stashbox in certain parts of your project.
`Metadata<,>` is a type from the `Stashbox` package, so you might prefer using `ValueTuple<,>` or `Tuple<,>` if you want to avoid referencing Stashbox in certain parts of your project.

You can also filter a collection of services by their metadata. Requesting `IEnumerable<Tuple<,>>` will yield only those services that have the given type of metadata.
You can also filter a collection of services by their metadata. Requesting `IEnumerable<ValueTuple<,>>` will yield only those services that have the given type of metadata.
<!-- div:right-panel -->

<!-- tabs:start -->
Expand All @@ -110,9 +110,13 @@ var jobWithConnectionString = container.Resolve<Metadata<IJob, string>>();
// prints: "connection-string-to-db"
Console.WriteLine(jobWithConnectionString.Data);

var alsoJobWithConnectionString = container.Resolve<Tuple<IJob, string>>();
var alsoJobWithConnectionString = container.Resolve<ValueTuple<IJob, string>>();
// prints: "connection-string-to-db"
Console.WriteLine(alsoJobWithConnectionString.Item2);

var stillJobWithConnectionString = container.Resolve<Tuple<IJob, string>>();
// prints: "connection-string-to-db"
Console.WriteLine(stillJobWithConnectionString.Item2);
```

##### **Collection filtering**
Expand All @@ -125,17 +129,17 @@ container.Register<IService, Service3>(options => options
.WithMetadata(5));

// the result is: [Service1, Service2]
var servicesWithStringMetadata = container.Resolve<Tuple<IService, string>[]>();
var servicesWithStringMetadata = container.Resolve<ValueTuple<IService, string>[]>();

// the result is: [Service3]
var servicesWithIntMetadata = container.Resolve<Tuple<IService, int>[]>();
var servicesWithIntMetadata = container.Resolve<ValueTuple<IService, int>[]>();
```

<!-- tabs:end -->

<!-- panels:end -->

?> Metadata can also be a complex type e.g., an `IDictionary<>`.
?> Metadata can also be a complex type e.g., an `IDictionary<,>`.

!> When no service found for a particular metadata type, the container throws a [ResolutionFailedException](diagnostics/validation?id=resolution-validation). In case of an `IEnumerable<>` request, an empty collection will be returned for a non-existing metadata.

Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/registration-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ container.Register<ILogger, ConsoleLogger>(options => options
<!-- panels:start -->
<!-- div:left-panel -->
### `WithMetadata`
Sets additional metadata for the registration. It's attached to the service upon its resolution through `Metadata<>` or `Tuple<>` wrappers.
Sets additional metadata for the registration. It's attached to the service upon its resolution through `ValueTuple<,>`, `Tuple<,>`, or `Metadata<,>` wrappers.
<!-- div:right-panel -->
```cs
container.Register<IJob, DbBackup>(options => options
.WithMetadata(connectionString));

var jobWithConnectionString = container.Resolve<Tuple<IJob, string>>();
var jobWithConnectionString = container.Resolve<ValueTuple<IJob, string>>();
Console.WriteLine(jobWithConnectionString.Item2); // prints the connection string.
```
Expand Down
2 changes: 1 addition & 1 deletion docs/diagnostics/utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ There might be cases when rather than finding out that a service is registered,
`CanResolve()` returns `true` only when at least one of the following is true:
- The requested type is registered in the current or one of the parent containers.
- The requested type is a closed generic type and its open generic definition is registered.
- The requested type is a wrapper (`IEnumerable<>`, `Lazy<>`, `Func<>`, `KeyValuePair<>`, `ReadOnlyKeyValue<>`, `Metadata<>`, or `Tuple<>`) and the underlying type is registered.
- The requested type is a wrapper (`IEnumerable<>`, `Lazy<>`, `Func<>`, `KeyValuePair<,>`, `ReadOnlyKeyValue<,>`, `Metadata<,>`, `ValueTuple<,>`, or `Tuple<,>`) and the underlying type is registered.
- The requested type is not registered but it's resolvable and the [unknown type resolution](configuration/container-configuration?id=unknown-type-resolution) is enabled.

<!-- div:right-panel -->
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Stashbox and its extensions are distributed via [NuGet](https://www.nuget.org/pa

You can install the package by typing the following into the Package Manager Console:
```
Install-Package Stashbox -Version 5.0.1
Install-Package Stashbox -Version 5.2.0
```

#### **dotnet CLI**

You can install the package by using the dotnet cli:
```
dotnet add package Stashbox --version 5.0.1
dotnet add package Stashbox --version 5.2.0
```

#### **PackageReference**

You can add the package into the package references of your `.csproj`:
```
<PackageReference Include="Stashbox" Version="5.0.1" />
<PackageReference Include="Stashbox" Version="5.2.0" />
```

<!-- tabs:end -->
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These are the latest stable and pre-release versions available:

Github (stable) | NuGet (stable) | Fuget (stable) | NuGet (daily)
--- | --- | --- | ---
[![Github release](https://img.shields.io/github/release/z4kn4fein/stashbox.svg)](https://github.com/z4kn4fein/stashbox/releases) | [![NuGet Version](https://buildstats.info/nuget/Stashbox)](https://www.nuget.org/packages/Stashbox/) | [![Stashbox on fuget.org](https://www.fuget.org/packages/Stashbox/badge.svg?v=5.0.1)](https://www.fuget.org/packages/Stashbox) | [![Nuget pre-release](https://img.shields.io/nuget/vpre/Stashbox)](https://www.nuget.org/packages/Stashbox/)
[![Github release](https://img.shields.io/github/release/z4kn4fein/stashbox.svg)](https://github.com/z4kn4fein/stashbox/releases) | [![NuGet Version](https://buildstats.info/nuget/Stashbox)](https://www.nuget.org/packages/Stashbox/) | [![Stashbox on fuget.org](https://www.fuget.org/packages/Stashbox/badge.svg?v=5.2.0)](https://www.fuget.org/packages/Stashbox) | [![Nuget pre-release](https://img.shields.io/nuget/vpre/Stashbox)](https://www.nuget.org/packages/Stashbox/)

## Core attributes
- 🚀 Fast, thread-safe, and lock-free operations.
Expand Down
6 changes: 2 additions & 4 deletions docs/usage/advanced-registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ container.Register<IJob, DbBackup>(options => options

<!-- div:left-panel -->
### Factories with parameter overrides
Suppose you'd want to use custom parameters for your service's instantiation rather than captured variables in lambda closures. In that case, you can register a `Func<>` delegate with parameters that you can use to pass your dependencies at resolution time.

?> This example is about pre-registered factories; however, the container can also implicitly [wrap](advanced/wrappers-resolvers?id=func) your service in a `Func<>` without pre-registering.
Stashbox can implicitly [wrap](advanced/wrappers-resolvers?id=func) your service in a `Func<>` delegate and lets you pass parameters that can override your service's dependencies. Moreover, you can register your own custom delegate that the container will resolve when you request your service wrapped in a `Func<>`.
<!-- div:right-panel -->

<!-- tabs:start -->
Expand All @@ -79,7 +77,7 @@ Suppose you'd want to use custom parameters for your service's instantiation rat
container.RegisterFunc<string, IJob>((connectionString, resolver) =>
new DbBackup(connectionString, resolver.Resolve<ILogger>()));

Func<string, IJob> backupFactory = container.ResolveFactory<string, IJob>();
Func<string, IJob> backupFactory = container.Resolve<Func<string, IJob>>();
IJob dbBackup = backupFactory(Configuration["ConnectionString"]);
```

Expand Down
8 changes: 4 additions & 4 deletions docs/usage/service-resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,24 +412,24 @@ IEnumerable<IJob> jobs = container.ResolveAll<IJob>();
## Optional resolution

<!-- div:left-panel -->
In cases where it's not guaranteed that a service is resolvable, either because it's not registered or any of its dependencies are missing, you can attempt an optional resolution by using the `nullResultAllowed` parameter of the `.Resolve()` method.
In cases where it's not guaranteed that a service is resolvable, either because it's not registered or any of its dependencies are missing, you can attempt an optional resolution by using the `ResolveOrDefault()` method.

In this case, the resolution request will return with `null` when the attempt fails.
In this case, the resolution request will return with `null` (or `default` in case of type values) when the attempt fails.
<!-- div:right-panel -->

<!-- tabs:start -->
#### **Generic API**
```cs
// returns null when the resolution fails.
IJob job = container.Resolve<IJob>(nullResultAllowed: true);
IJob job = container.ResolveOrDefault<IJob>();

// throws ResolutionFailedException when the resolution fails.
IJob job = container.Resolve<IJob>();
```
#### **Runtime type API**
```cs
// returns null when the resolution fails.
object job = container.Resolve(typeof(IJob), nullResultAllowed: true);
object job = container.ResolveOrDefault(typeof(IJob));

// throws ResolutionFailedException when the resolution fails.
object job = container.Resolve(typeof(IJob));
Expand Down
47 changes: 47 additions & 0 deletions sandbox/stashbox.benchmarks/DecoratorBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
extern alias from_nuget;
extern alias from_project;
using BenchmarkDotNet.Attributes;

namespace Stashbox.Benchmarks
{
[MemoryDiagnoser]
public class DecoratorBenchmarks
{
private readonly from_nuget::Stashbox.IStashboxContainer oldContainer =
new from_nuget::Stashbox.StashboxContainer();

private readonly from_project::Stashbox.IStashboxContainer newContainer =
new from_project::Stashbox.StashboxContainer();

[GlobalSetup]
public void Setup()
{
this.oldContainer.Register<IA, A>()
.RegisterDecorator<IA, ADec>();

this.newContainer.Register<IA, A>()
.RegisterDecorator<IA, ADec>();
}

[Benchmark(Baseline = true)]
public object Old()
{
return this.oldContainer.Resolve(typeof(IA));
}

[Benchmark]
public object New()
{
return this.newContainer.Resolve(typeof(IA));
}

interface IA { }

class A : IA { }

class ADec : IA
{
public ADec(IA a) { }
}
}
}
1 change: 1 addition & 0 deletions sandbox/stashbox.benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ static void Main(string[] args)
//BenchmarkRunner.Run<NullableBenchmarks>();
//BenchmarkRunner.Run<BeginScopeBenchmarks>();
//BenchmarkRunner.Run<SingletonBenchmarks>();
//BenchmarkRunner.Run<DecoratorBenchmarks>();
Console.ReadKey();
}
}
Expand Down
2 changes: 1 addition & 1 deletion sandbox/stashbox.benchmarks/Stashbox.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="Stashbox" Version="5.0.0" />
<PackageReference Include="Stashbox" Version="5.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
Expand Down
4 changes: 2 additions & 2 deletions src/Attributes/DependencyAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public class DependencyAttribute : Attribute
/// <summary>
/// The name of the dependency.
/// </summary>
public object Name { get; set; }
public object? Name { get; set; }

/// <summary>
/// Constructs a <see cref="DependencyAttribute"/>
/// </summary>
/// <param name="name">The name of the dependency.</param>
public DependencyAttribute(object name = null)
public DependencyAttribute(object? name = null)
{
this.Name = name;
}
Expand Down
Loading

0 comments on commit 8c6006c

Please sign in to comment.