Exemple #1
0
 public RepositoryFactory(ICypherTransactionFactory cypherTransactionFactory, IProxyFactory proxyFactory, IMetadataFactory metadataFactory)
 {
     _mappers = new ConcurrentDictionary <Type, Func <IGraphSession, IMapper> >();
     _cypherTransactionFactory = cypherTransactionFactory;
     _proxyFactory             = proxyFactory;
     _metadataFactory          = metadataFactory;
 }
Exemple #2
0
 public GetQueryExecutor(ICypherTransactionFactory transactionFactory,
                         IMetadataFactory metadataFactory,
                         Func <IRecord, TResult> map, Func <ICypherReturn <TResult>,
                                                            ICypherReturn <TResult> > returnFactory) : base(transactionFactory, metadataFactory)
 {
     _map           = map;
     _returnFactory = returnFactory;
 }
Exemple #3
0
 public RepositoryFactory(IDriver db, ICypherTransactionFactory cypherTransactionFactory, IProxyFactory proxyFactory, IMetadataFactory metadataFactory, params Assembly[] assemblies)
     : this(cypherTransactionFactory, proxyFactory, metadataFactory)
 {
     foreach (var assembly in assemblies)
     {
         var types = assembly.GetTypes().Where(x => typeof(IMapper).IsAssignableFrom(x));
         foreach (var type in types)
         {
             foreach (var item in type.GetInterfaces())
             {
                 var arguments = item.GetGenericArguments();
                 if (arguments.Any())
                 {
                     var local = type;
                     Register(session => (IMapper)Activator.CreateInstance(local, session, _cypherTransactionFactory, _metadataFactory), arguments[0]);
                 }
             }
         }
     }
 }
Exemple #4
0
        public QueryExecutorFactory(ICypherTransactionFactory transactionFactory, IMetadataFactory metadataFactory, params Assembly[] assemblies) : this(metadataFactory)
        {
            foreach (var assembly in assemblies)
            {
                var types = assembly.GetTypes().Where(x => typeof(IQueryExecutor).IsAssignableFrom(x));

                foreach (var type in types)
                {
                    if (type.BaseType == null)
                    {
                        continue;
                    }

                    var arguments = type.BaseType.GetGenericArguments();

                    if (arguments.Length == 3)
                    {
                        var local = type;

                        Register(session => (IQueryExecutor)Activator.CreateInstance(local, transactionFactory, _metadataFactory), arguments[2]);
                    }
                }
            }
        }
Exemple #5
0
 public PersonMapper(IGraphSession session, ICypherTransactionFactory transactionFactory, IMetadataFactory metadataFactory)
     : base(session, transactionFactory, metadataFactory)
 {
 }
 protected AbstractQueryExecutor(ICypherTransactionFactory transactionFactory, IMetadataFactory metadataFactory)
 {
     _transactionFactory = transactionFactory;
     _metadataFactory    = metadataFactory;
 }
Exemple #7
0
 protected Mapper(IGraphSession session, ICypherTransactionFactory transactionFactory, IMetadataFactory metadataFactory)
 {
     _session            = session;
     _transactionFactory = transactionFactory;
     MetadataFactory     = metadataFactory;
 }
 protected GenericQueryExecutor(ICypherTransactionFactory transactionFactory, IMetadataFactory metadataFactory) 
     : base(transactionFactory, metadataFactory)
 {
 }
 public GetMoviesByTitleExecutor(ICypherTransactionFactory transactionFactory, IMetadataFactory metadataFactory)
     : base(transactionFactory, metadataFactory)
 {
 }