add class constraint

This commit is contained in:
chris.watts90@outlook.com 2017-06-26 21:02:58 +01:00
parent 19d53cb33b
commit 80b0b5aab7
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ namespace Interfaces
{
public interface IPluginLocator
{
Task<List<T>> LocateAsync<T>();
List<T> Locate<T>();
Task<List<T>> LocateAsync<T>() where T : class;
List<T> Locate<T>() where T : class;
}
}

View File

@ -21,12 +21,12 @@ namespace RaceLapTimer.Extensions
_logger = logger;
}
public async Task<List<T>> LocateAsync<T>()
public async Task<List<T>> LocateAsync<T>() where T:class
{
return await Task.Run(() => Locate<T>());
}
public List<T> Locate<T>()
public List<T> Locate<T>() where T:class
{
try
{