Start to port main gut of the foundation

This commit is contained in:
Daniel Clark
2022-12-05 17:47:16 +00:00
parent 82a83456f4
commit 3b09265a30
44 changed files with 1075 additions and 1 deletions
@@ -0,0 +1,21 @@
namespace Toolkit.Foundation
{
public static class IServiceFactoryExtensions
{
public static T? Get<T>(this IServiceFactory serviceFactory)
{
return serviceFactory.Get<T>(typeof(T));
}
public static T Create<T>(this IServiceFactory serviceFactory, params object?[] parameters)
{
return serviceFactory.Create<T>(typeof(T), parameters);
}
public static object? Create(this IServiceFactory serviceFactory, Type type)
{
ServiceFactoryDescriptor? descriptor = new(serviceFactory);
return descriptor.Create(type);
}
}
}