Ejemplo n.º 1
0
        public static IServiceCollection AddArango(this IServiceCollection collection, string connectionString,
                                                   IArangoConfiguration settings = null)
        {
            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }
            if (connectionString == null)
            {
                throw new ArgumentNullException(nameof(connectionString));
            }

            return(collection.AddSingleton <IArangoContext>(serviceProvider =>
                                                            new ArangoContext(connectionString, settings)));
        }
Ejemplo n.º 2
0
        public ArangoContext(IArangoConfiguration config)
        {
            Configuration = config ?? throw new ArgumentNullException(nameof(config));

            User        = new ArangoUserModule(this);
            Collection  = new ArangoCollectionModule(this);
            View        = new ArangoViewModule(this);
            Database    = new ArangoDatabaseModule(this);
            Graph       = new ArangoGraphModule(this);
            Transaction = new ArangoTransactionModule(this);
            Document    = new ArangoDocumentModule(this);
            Query       = new ArangoQueryModule(this);
            Index       = new ArangoIndexModule(this);
            Analyzer    = new ArangoAnalyzerModule(this);
            Function    = new ArangoFunctionModule(this);
        }
Ejemplo n.º 3
0
        public ArangoContext(string cs, IArangoConfiguration settings = null)
        {
            Configuration = settings ?? new ArangoConfiguration();
            Configuration.ConnectionString = cs;

            User        = new ArangoUserModule(this);
            Collection  = new ArangoCollectionModule(this);
            View        = new ArangoViewModule(this);
            Database    = new ArangoDatabaseModule(this);
            Graph       = new ArangoGraphModule(this);
            Transaction = new ArangoTransactionModule(this);
            Document    = new ArangoDocumentModule(this);
            Query       = new ArangoQueryModule(this);
            Index       = new ArangoIndexModule(this);
            Analyzer    = new ArangoAnalyzerModule(this);
            Function    = new ArangoFunctionModule(this);
        }
Ejemplo n.º 4
0
 public ArangoHttpTransport(IArangoConfiguration configuration)
 {
     _configuration = configuration;
 }