本文整理匯總了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"]);
}
}
示例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;
}
}