Skip to content

Commit

Permalink
Fix: InjectAttribute can not target to constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mewlist committed Feb 20, 2024
1 parent 1150d5c commit 69a18c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Runtime/Attribute/InjectAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Doinject
{
[AttributeUsage(AttributeTargets.Method)]
[AttributeUsage(AttributeTargets.Constructor|AttributeTargets.Method)]
public class InjectAttribute : Attribute
{
}
Expand Down
1 change: 1 addition & 0 deletions Tests/TestObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class WithArgsObject : IAsyncDisposable
public string Arg2 { get; }
public List<int> Arg3 { get; }

[Inject]
public WithArgsObject(int arg1, InjectedObject injectedObject, string arg2, List<int> arg3)
{
InjectedObject = injectedObject;
Expand Down

0 comments on commit 69a18c9

Please sign in to comment.