本文整理汇总了C#中DataManager.Save方法的典型用法代码示例。如果您正苦于以下问题:C# DataManager.Save方法的具体用法?C# DataManager.Save怎么用?C# DataManager.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveToDatabase
public virtual void SaveToDatabase(DataManager.UowSchuleDB UnitofWork)
{
string settings = GetSettingsAsString();
if (!String.IsNullOrEmpty(settings))
{
UnitofWork.Settings["OutputTemplate.Settings." + GetType().FullName] = new Model.Setting("OutputTemplate.Settings." + GetType().FullName, settings);
UnitofWork.Save();
}
}
示例2: IncreasePopulation
public void IncreasePopulation(Tile tile, Person[] newPeople)
{
var people = new List<Person> (tile.People);
people.AddRange (newPeople);
tile.People = people.ToArray ();
var data = new DataManager ();
for (int i = 0; i < newPeople.Length; i++)
data.Save (newPeople [i]);
}
示例3: Main
public static void Main(string[] args)
{
var dataManager = new DataManager();
for (int i = 0; i < 500; i++) {
var item = new ExampleInvoiceItem ();
var invoice = new ExampleInvoice ();
invoice.Items = new ExampleInvoiceItem[]{ item };
dataManager.Save (invoice);
dataManager.SaveLinkedEntities (invoice);
}
}
示例4: Test_TwoWayReference_RemoveOnDelete
// TODO: Remove or reimplement
//[Test]
public void Test_TwoWayReference_RemoveOnDelete()
{
Console.WriteLine ("");
Console.WriteLine ("Preparing test...");
Console.WriteLine ("");
var data = new DataManager();
data.Settings.IsVerbose = true;
data.WriteSummary ();
var invoiceItem = new ExampleInvoiceItem ();
var invoice = new ExampleInvoice (invoiceItem);
data.Save(invoice, true);
data.WriteSummary ();
Console.WriteLine ("");
Console.WriteLine ("Executing test code...");
Console.WriteLine ("");
data.Delete(invoice);
data.WriteSummary ();
var newInvoice = data.Get<ExampleInvoice> (invoice.Id);
Assert.AreEqual(0, newInvoice.Items.Length, "Linker failed to remove the link.");
}