rename to EnsureGet
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Pilz.Plugins.Advanced.Exceptions;
|
using Pilz.Plugins.Advanced.Exceptions;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Pilz.Plugins.Advanced;
|
namespace Pilz.Plugins.Advanced;
|
||||||
@@ -207,7 +208,7 @@ public class PluginFeatureController
|
|||||||
return GetAll<T>().FirstOrDefault();
|
return GetAll<T>().FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual T? Get<T>(bool throwIfNull) where T : PluginFeature
|
public virtual T EnsureGet<T>() where T : PluginFeature
|
||||||
{
|
{
|
||||||
if (Get<T>() is T feature)
|
if (Get<T>() is T feature)
|
||||||
return feature;
|
return feature;
|
||||||
|
|||||||
Reference in New Issue
Block a user