当前位置: 首页>>代码示例>>C#>>正文


C# IDbConnection.DropAndCreateTable方法代码示例

本文整理汇总了C#中IDbConnection.DropAndCreateTable方法的典型用法代码示例。如果您正苦于以下问题:C# IDbConnection.DropAndCreateTable方法的具体用法?C# IDbConnection.DropAndCreateTable怎么用?C# IDbConnection.DropAndCreateTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDbConnection的用法示例。


在下文中一共展示了IDbConnection.DropAndCreateTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestFixtureSetUp

 public void TestFixtureSetUp()
 {
     db = base.OpenDbConnection();
     db.DropAndCreateTable<Customer>();
     db.DropAndCreateTable<CustomerAddress>();
     db.DropAndCreateTable<Order>();
 }
开发者ID:nunopimenta,项目名称:ServiceStack.OrmLite,代码行数:7,代码来源:LoadReferencesTests.cs

示例2: SetUp

 public void SetUp()
 {
     SuppressIfOracle("SQL Server tests");
     db = CreateSqlServerDbFactory().OpenDbConnection();
     db.DropAndCreateTable<Person>();
     db.DropAndCreateTable<PersonWithAutoId>();
 }
开发者ID:jessemcdowell-AI,项目名称:ServiceStack.OrmLite,代码行数:7,代码来源:ApiSqlServerTestsAsync.cs

示例3: CreateArtistAndTrackTablesWithData

 public IDbConnection CreateArtistAndTrackTablesWithData(IDbConnection db)
 {
     db.DropAndCreateTable<Artist>();
     db.DropAndCreateTable<Track>();
     Artists.Each(x => db.Save(x, references: true));
     return db;
 }
开发者ID:CormacBrennan-AI,项目名称:ServiceStack.OrmLite,代码行数:7,代码来源:ArtistTrackTestBase.cs

示例4: SetUp

        public void SetUp()
        {
            db = ConnectionString.OpenDbConnection();
            db.DropAndCreateTable<Person>();
            db.DropAndCreateTable<AutoIdPerson>();

            //People.ToList().ForEach(x => dbCmd.Insert(x));
        }
开发者ID:yeurch,项目名称:ServiceStack.OrmLite,代码行数:8,代码来源:ApiExpressionTests.cs

示例5: CreateFutureStackDb

        private static void CreateFutureStackDb(IDbConnection dbConnection)
        {
            if (dbConnection.State != ConnectionState.Open) dbConnection.Open();

            dbConnection.DropAndCreateTable<Customer>();
            dbConnection.DropAndCreateTable<Address>();

            dbConnection.Close();
        }
开发者ID:CharlesSelvaraj,项目名称:FutureStack,代码行数:9,代码来源:Program.cs

示例6: SetUp

        public void SetUp()
        {
            //db = OpenDbConnection();
            db = CreateSqlServerDbFactory().OpenDbConnection();
            db.DropAndCreateTable<Person>();
            db.DropAndCreateTable<AutoIdPerson>();

            //People.ToList().ForEach(x => dbCmd.Insert(x));
        }
开发者ID:sami1971,项目名称:ServiceStack.OrmLite-1,代码行数:9,代码来源:ApiExpressionTests.cs

示例7: TestFixtureSetUp

        public new void TestFixtureSetUp()
        {
            db = base.OpenDbConnection();
            CustomerOrdersUseCase.DropTables(db); //Has conflicting 'Order' table

            db.DropAndCreateTable<Order>();
            db.DropAndCreateTable<Customer>();
            db.DropAndCreateTable<CustomerAddress>();
            db.DropAndCreateTable<Country>();
        }
开发者ID:ServiceStack,项目名称:ServiceStack.OrmLite,代码行数:10,代码来源:LoadReferencesTestsAsync.cs

示例8: Init

        public void Init(IDbConnection db)
        {
            db.DropAndCreateTable<Person>();
            db.DropAndCreateTable<Band>();

            db.InsertAll(Person.Rockstars);

            db.Insert(new Band { Name = "The Doors", PersonId = 3 });
            db.Insert(new Band { Name = "Nirvana", PersonId = 4 });
        }
开发者ID:JohnKlippenstein-AI,项目名称:ServiceStack.OrmLite,代码行数:10,代码来源:FromExpressionTests.cs

示例9: Init

        private static void Init(IDbConnection db)
        {
            db.DropAndCreateTable<ClassA>();
            db.DropAndCreateTable<ClassB>();

            _classAColumnAId = db.Insert(new ClassA { ColumnA = "1" }, true);
            db.Insert(new ClassA { ColumnA = "2" });
            db.Insert(new ClassA { ColumnA = "3" });

            db.Insert(new ClassB { ColumnB = "1" });
            db.Insert(new ClassB { ColumnB = "2" });
        }
开发者ID:wrx362114,项目名称:ServiceStack.OrmLite,代码行数:12,代码来源:ComplexJoinWithAlias.cs

示例10: Setup

 public void Setup()
 {
     _connectionString = ConfigurationManager.ConnectionStrings["Database"].ConnectionString;
     var dbFactory = new OrmLiteConnectionFactory(_connectionString, SqlServerDialect.Provider);
     _connection = dbFactory.Open();
     _connection.DropAndCreateTable<AzureTraceMessage>();
 }
开发者ID:MRCollective,项目名称:AzureTraceListeners,代码行数:7,代码来源:AzureSqlTraceListenerTests.cs

示例11: CreateAndInitialize

        private DefaultValues CreateAndInitialize(IDbConnection db, int count = 1)
        {
            db.DropAndCreateTable<DefaultValues>();
            db.GetLastSql().Print();

            DefaultValues firstRow = null;
            for (var i = 1; i <= count; i++)
            {
                var defaultValues = new DefaultValues { Id = i };
                db.Insert(defaultValues);

                var row = db.SingleById<DefaultValues>(1);
                row.PrintDump();
                Assert.That(row.DefaultInt, Is.EqualTo(1));
                Assert.That(row.DefaultIntNoDefault, Is.EqualTo(0));
                Assert.That(row.NDefaultInt, Is.EqualTo(1));
                Assert.That(row.DefaultDouble, Is.EqualTo(1.1).Within(.1d));
                Assert.That(row.NDefaultDouble, Is.EqualTo(1.1).Within(.1d));
                Assert.That(row.DefaultString, Is.EqualTo("String"));

                if (firstRow == null)
                    firstRow = row;
            }

            return firstRow;
        }
开发者ID:BruceCowan-AI,项目名称:ServiceStack.OrmLite,代码行数:26,代码来源:DefaultValueTests.cs

示例12: CreateModelWithFieldsOfDifferentTypes

        private ModelWithFieldsOfDifferentTypes CreateModelWithFieldsOfDifferentTypes(IDbConnection db)
        {
            db.DropAndCreateTable<ModelWithFieldsOfDifferentTypes>();

            var row = ModelWithFieldsOfDifferentTypes.Create(1);
            return row;
        }
开发者ID:adwardliu,项目名称:ServiceStack.OrmLite,代码行数:7,代码来源:OrmLiteUpdateTests.cs

示例13: InsertAndSelectDateTime

 private static DateTimeObject InsertAndSelectDateTime(IDbConnection db, DateTime dateTime)
 {
     db.DropAndCreateTable<DateTimeObject>();
     db.Insert(new DateTimeObject {Test = dateTime});
     var x = db.Select<DateTimeObject>().First();
     return x;
 }
开发者ID:yeurch,项目名称:ServiceStack.OrmLite,代码行数:7,代码来源:EnsureUtcTest.cs

示例14: TestFixtureSetUp

        public void TestFixtureSetUp()
        {
            db = base.OpenDbConnection();

            db.DropAndCreateTable<Person>();
            db.InsertAll(Person.Rockstars);
        }
开发者ID:wrx362114,项目名称:ServiceStack.OrmLite,代码行数:7,代码来源:MockAllApiTests.cs

示例15: InsertModelWithComplexType

        private static void InsertModelWithComplexType(IDbConnection db)
        {
            db.DropAndCreateTable<ModelWithComplexType>();

            db.Insert(new ModelWithComplexType {
                Id = 1,
                ComplexType = new ComplexType { Id = 2, SubType = new SubType { Name = "Sub" } }
            });
        }
开发者ID:josiahpeters,项目名称:ServiceStack.OrmLite,代码行数:9,代码来源:StringSerializerTests.cs


注:本文中的IDbConnection.DropAndCreateTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。