本文整理汇总了C#中TestDataConnection.Merge方法的典型用法代码示例。如果您正苦于以下问题:C# TestDataConnection.Merge方法的具体用法?C# TestDataConnection.Merge怎么用?C# TestDataConnection.Merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestDataConnection
的用法示例。
在下文中一共展示了TestDataConnection.Merge方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Merge
public void Merge(string context)
{
using (var db = new TestDataConnection(context))
{
db.Merge(db.Types2);
}
}
示例2: MergeWithDeletePredicate2
public void MergeWithDeletePredicate2(string context)
{
using (var db = new TestDataConnection(context))
{
db.Merge(db.Types2, t => t.ID > 5);
}
}
示例3: MergeWithEmptySource
public void MergeWithEmptySource(string context)
{
using (var db = new TestDataConnection(context))
{
db.Merge(new Person[] {});
}
}
示例4: MergeWithDeletePredicate3
public void MergeWithDeletePredicate3(string context)
{
using (var db = new TestDataConnection(context))
{
var patient = db.Patient.First();
db.Merge(db.Person, t => t.Patient == patient);
}
}
示例5: MergeChar1
public void MergeChar1(string context)
{
using (var db = new TestDataConnection(context))
{
var id = ConvertTo<int>.From(db.GetTable<AllType>().InsertWithIdentity(() => new AllType
{
charDataType = '\x0',
ncharDataType = "\x0"
}));
try
{
db.Merge(db.GetTable<AllType>().Where(t => t.ID == id));
}
finally
{
db.GetTable<AllType>().Delete(t => t.ID == id);
}
}
}
示例6: MergeChar2
public void MergeChar2(string context)
{
using (var db = new TestDataConnection(context))
{
try
{
db.Merge(new[]
{
new AllType
{
ID = 10,
charDataType = '\x0',
ncharDataType = "\x0"
}
});
}
finally
{
db.GetTable<AllType>().Delete(t => t.ID == 10);
}
}
}
示例7: MergeWithDeletePredicate5
public void MergeWithDeletePredicate5(string context)
{
using (var db = new TestDataConnection(context))
{
db.Merge(db.Child, t => t.Parent.ParentID == 2 && t.GrandChildren.Any(g => g.Child.ChildID == 22));
}
}