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


C# testEntities.AddToChildren方法代码示例

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


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

示例1: TimeType

        public void TimeType()
        {
            using (testEntities context = new testEntities())
            {
                TimeSpan birth = new TimeSpan(11,3,2);

                Child c = new Child();
                c.Id = 20;
                c.EmployeeID = 1;
                c.FirstName = "first";
                c.LastName = "last";
                c.BirthTime = birth;
                context.AddToChildren(c);
                context.SaveChanges();

                MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM EmployeeChildren WHERE id=20", conn);
                DataTable dt = new DataTable();
                da.Fill(dt);
                Assert.AreEqual(birth, dt.Rows[0]["birthtime"]);
            }
        }
开发者ID:LittlePeng,项目名称:ncuhome,代码行数:21,代码来源:DataTypeTests.cs

示例2: DoubleValuesNonEnglish

        public void DoubleValuesNonEnglish()
        {
            CultureInfo curCulture = Thread.CurrentThread.CurrentCulture;
            CultureInfo curUICulture = Thread.CurrentThread.CurrentUICulture;
            CultureInfo newCulture = new CultureInfo("da-DK");
            Thread.CurrentThread.CurrentCulture = newCulture;
            Thread.CurrentThread.CurrentUICulture = newCulture;

            try
            {
                using (testEntities context = new testEntities())
                {
                    Child c = new Child();
                    c.Id = 20;
                    c.EmployeeID = 1;
                    c.FirstName = "Bam bam";
                    c.LastName = "Rubble";
                    c.BirthWeight = 8.65;
                    context.AddToChildren(c);
                    context.SaveChanges();
                }
            }
            finally
            {
                Thread.CurrentThread.CurrentCulture = curCulture;
                Thread.CurrentThread.CurrentUICulture = curUICulture;
            }
        }
开发者ID:LittlePeng,项目名称:ncuhome,代码行数:28,代码来源:DataTypeTests.cs


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