-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use reflection-based ParameterInfo for service injection
- Loading branch information
Showing
10 changed files
with
69 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Reflection; | ||
|
||
namespace Bunkum.Core; | ||
|
||
/// <summary> | ||
/// A parameter used for injection information. | ||
/// </summary> | ||
/// <seealso cref="ParameterInfo"/> | ||
public class BunkumParameterInfo | ||
{ | ||
/// <summary> | ||
/// Instantiates a set of parameter info. | ||
/// </summary> | ||
/// <param name="parameterType">The parameter's type.</param> | ||
/// <param name="name">The parameter's name.</param> | ||
public BunkumParameterInfo(Type parameterType, string name) | ||
{ | ||
this.ParameterType = parameterType; | ||
this.Name = name; | ||
} | ||
|
||
/// <summary> | ||
/// Instantiates a set of parameter info from existing reflection data. | ||
/// </summary> | ||
/// <param name="parameter">The reflection data to use.</param> | ||
public BunkumParameterInfo(ParameterInfo parameter) | ||
{ | ||
this.ParameterType = parameter.ParameterType; | ||
this.Name = parameter.Name; | ||
} | ||
|
||
/// <summary> | ||
/// The type of the parameter. | ||
/// </summary> | ||
public Type ParameterType { get; } | ||
/// <summary> | ||
/// The name of the parameter. | ||
/// </summary> | ||
public string? Name { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters