Exemplo n.º 1
0
        public void JsonSave()
        {
            var config = new ConnConfig
            {
                Key1 = "xyz-yop",
                Key2 = "http://abc.com"
            };
            var result = new JsonShell <ConnConfig>().Save(config, @"C:\Dev\Configs\test.json");

            Assert.True(result);
        }
Exemplo n.º 2
0
        static Prepare()
        {
            var config = new JsonShell <ConnConfig>().Load(@"C:\Dev\Configs\sql.json");

            EntityUnifier.Factory()
            /* Use defualt context */
            .UseDefaultContext(Connection.CreateSqlServer(config.Key1, config.Key2, config.Key3, config.Password))
            .Register <Author>()
            .Register <Book>(b => b.Id);
            _preped = true;
        }
Exemplo n.º 3
0
        static Prepare()
        {
            var config = new JsonShell <ConnConfig>().Load(@"C:\Dev\Configs\sql.json");

            EntityUnifier.Factory()
            /* Use defualt context */
            .UseDefaultContext(Connection.CreateSqlServer(config.Key1, config.Key2, config.Key3, config.Password), "sql-context")
            .Register <Author>()
            .UseDefaultContext(Connection.CreateMongo("localhost", "bookdb"), "mongo-context")
            .Register <AuthorMongo>(collectionName: "Authors");
            _preped = true;
        }
Exemplo n.º 4
0
        static Prepare()
        {
            var config = new JsonShell <ConnConfig>().Load(@"C:\Dev\Configs\cosmos.json");

            EntityUnifier.Factory()
            .UseDefaultContext(Connection.CreateCosmos(config.Key1, config.Key2, "BookDB"))
            .Register <Author>("Author", o => o.Id)
            .SpecialKey("PartitionKey", TypeCatalogue.SpecialKey.PartitionKey)
            .Register <Book>("Books", o => o.Id)
            .SpecialKey("PartitionKey", TypeCatalogue.SpecialKey.PartitionKey);
            _preped = true;
        }
Exemplo n.º 5
0
        static Prepare()
        {
            var config = new JsonShell <ConnConfig>().Load(@"C:\Dev\Configs\dynamo.json");

            EntityUnifier.Factory()
            .UseDefaultContext(Connection.CreateDynamo(config.Key1, config.Key2, TypeCatalogue.AmazonRegion.USEast2))
            .Register <Author>(collectionName: "Authors")
            .SpecialKey("Id", TypeCatalogue.SpecialKey.PartitionKey)
            .Register <Books>(collectionName: "Books")
            .SpecialKey("PartKey", TypeCatalogue.SpecialKey.PartitionKey)
            .Register <Novel>(collectionName: "Novel")
            .SpecialKey("PartKey", TypeCatalogue.SpecialKey.PartitionKey)
            .SpecialKey("Id", TypeCatalogue.SpecialKey.SortKey);
            _preped = true;
        }
        public async Task <IActionResult> ConverToShellObject([FromBody] List <string> paths)
        {
            var shell = JsonShell.GenerateFromPaths(paths);

            return(Ok(shell));
        }