Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace XUYTA.Core.Framework.Unity.Factories
- {
- /// <summary>
- /// Calls FactoryGenerator and creates instance of factory.
- /// </summary>
- internal class FactoryActivator
- {
- public object CreateInstance(IUnityContainer container, Type concreteFactoryType)
- {
- var constructor = concreteFactoryType.GetConstructor(new[] {typeof (IUnityContainer)});
- if (constructor == null)
- {
- throw new FactoryGeneratorException(
- "Generated factory doesn't have public constructor with IUnityContainer parameter. " +
- "There's something wrong with FactoryGenerator.");
- }
- return constructor.Invoke(new object[] {container});
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement