Initial Commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
public static class ProviderUtil
|
||||
{
|
||||
public static Type GetTypeToInstantiate(Type contractType, Type concreteType)
|
||||
{
|
||||
#if !(UNITY_WSA && ENABLE_DOTNET)
|
||||
// TODO: Is it possible to do this on WSA?
|
||||
|
||||
if (concreteType.IsOpenGenericType())
|
||||
{
|
||||
return concreteType.MakeGenericType(contractType.GetGenericArguments());
|
||||
}
|
||||
#endif
|
||||
|
||||
Assert.DerivesFromOrEqual(concreteType, contractType);
|
||||
return concreteType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user