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


C# DataManager.Save方法代码示例

本文整理汇总了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();
            }
        }
开发者ID:Nelvin73,项目名称:Schule,代码行数:10,代码来源:OutputTemplateConfigBase.cs

示例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]);
        }
开发者ID:CompulsiveCoder,项目名称:TileSim,代码行数:12,代码来源:PopulationEffect.cs

示例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);
            }
        }
开发者ID:CompulsiveCoder,项目名称:datamanager,代码行数:15,代码来源:Program.cs

示例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.");
        }
开发者ID:CompulsiveCoder,项目名称:datamanager,代码行数:32,代码来源:DataLinkerIntegrationTestFixture.cs


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