private static object Instantiate(Type type, IDieContainer container) { var constructorInfo = type.GetConstructors().Single(); var parameters = constructorInfo .GetParameters() .Select(parameter => parameter.ParameterType) .Select(container.Get) .ToArray(); return(constructorInfo.Invoke(parameters)); }
public static void RegisterData(this IDieContainer container) { container.Register(Assembly.GetExecutingAssembly()); }