private object CreateRepositoryFromEntityType(Type entityModelType) { //Creates repository of param type var repositoryFactory = _helper.GetMethod <IUnitOfWork>(RepositoryMethodName); var genericMethod = _helper.MakeGenericMethod(repositoryFactory, entityModelType); var result = _helper.InvokeMethod(_unitOfWork, genericMethod, new object[] { }); return(result); }