Skip to content

Commit

Permalink
Make options not required by having parameterless ctor new up the opt…
Browse files Browse the repository at this point in the history
…ions itself.

Fixes Remora#2.
  • Loading branch information
AraHaan authored Jul 8, 2022
1 parent 88af627 commit a724e45
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Remora.Plugins/Services/PluginService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,30 @@ public sealed class PluginService
{
private readonly PluginServiceOptions _options;

/// <summary>
/// Initializes a new instance of the <see cref="PluginService"/> class.
/// </summary>
public PluginService()
: this(new PluginServiceOptions())
{
}

/// <summary>
/// Initializes a new instance of the <see cref="PluginService"/> class.
/// </summary>
/// <param name="options">The service options.</param>
public PluginService(IOptions<PluginServiceOptions> options)
: this(options.Value)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="PluginService"/> class.
/// </summary>
/// <param name="options">The service options.</param>
public PluginService(PluginServiceOptions options)
{
_options = options.Value;
_options = options;
}

/// <summary>
Expand Down

0 comments on commit a724e45

Please sign in to comment.