private MetadataEntityDBConfig GetMetadataEntityDBConfig <T>() where T : MetadataEntity
        {
            if (configDBAdapter == null)
            {
                throw new Exception("Method 'Initialize' should be invoke first!");
            }

            var entityName = typeof(T).Name;

            return(configDBAdapter.Get <MetadataEntityDBConfig>(MetadataEntityDBConfig.TableName, entityName));
        }
Exemple #2
0
        public void GetTest()
        {
            const string tableName = nameof(TestObject);

            using var context = new IBoxDBAdapter();
            context.EnsureTable <TestObject>(tableName, "Id");
            context.Open();
            context.Insert(tableName, new TestObject(1L, "Test1"));
            var result = context.Get <TestObject>(tableName, "Name", "Test1");

            Assert.AreEqual(1L, result[0].Id);
        }