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


C# IObjectContainer.Store方法代码示例

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


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

示例1: StoreData

 private void StoreData(IObjectContainer container)
 {
     container.Store(new Person("Roman","Stoffel")
                         {
                             Address = new Address()
                                           {
                                               City = "Zurich",
                                               Street = "FunStreet"
                                           }
                         });    
     container.Store(new Person("Joe","Cool")
                         {
                             Address = new Address()
                                           {
                                               City = "FunTown",
                                               Street = "Fun Plaza"
                                           }
                         });
     container.Store(new Person("Joanna", "Awesome")
     {
         Address = new Address()
         {
             City = "More Fun Town",
             Street = "Plaza"
         }
     });          
 }
开发者ID:Galigator,项目名称:db4o,代码行数:27,代码来源:ReportForm.cs

示例2: PopulateContainer

		protected override void PopulateContainer(IObjectContainer container)
		{
			MyTestClass test1 = new MyTestClass();
			container.Store(test1);

			MyTestClass test2 = new MyTestClass();
			container.Store(test2);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:JavaUUIDCompatibilityTestCase.cs

示例3: StoreSecondCar

 public static void StoreSecondCar(IObjectContainer db)
 {
     Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
     db.Store(pilot2);
     Car car2 = new Car("BMW");
     car2.Pilot = pilot2;
     db.Store(car2);
 }
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:StructuredExample.cs

示例4: CommitChanges

        private static void CommitChanges(IObjectContainer container)
        {
            // #example: Rollback changes
            container.Store(new Pilot("John"));
            container.Store(new Pilot("Joanna"));

            container.Rollback();
            // #end example
        }
开发者ID:Galigator,项目名称:db4o,代码行数:9,代码来源:Transactions.cs

示例5: StoreInitialObjects

        // #end example:

        private void StoreInitialObjects(IObjectContainer container)
        {
            lock (dataLock)
            {
                container.Store(new Person("Joe"));
                container.Store(new Person("Jan"));
                container.Store(new Person("Joanna"));
                container.Store(new Person("Phil"));
            }
        }
开发者ID:Galigator,项目名称:db4o,代码行数:12,代码来源:LockingOperations.cs

示例6: StoreData

        private static void StoreData(IObjectContainer container)
        {
            Pilot john = new Pilot("John", 42);
            Pilot joanna = new Pilot("Joanna", 45);
            Pilot jenny = new Pilot("Jenny", 21);
            Pilot rick = new Pilot("Rick", 33);

            container.Store(new Car(john, "Ferrari"));
            container.Store(new Car(joanna, "Mercedes"));
            container.Store(new Car(jenny, "Volvo"));
            container.Store(new Car(rick, "Fiat"));
        }
开发者ID:Galigator,项目名称:db4o,代码行数:12,代码来源:NativeQueriesSorting.cs

示例7: StoreState

		public void StoreState(IObjectContainer container) {
            if (null != state)
            {
                if (OnlyNeedUpdate(container))
                {
                    container.Store(state.CurrentHighestIds); 
                } else
                {
                    container.Store(state);  
                }
			}
		}
开发者ID:masroore,项目名称:Db4objects.Db4o.Extras,代码行数:12,代码来源:IdGenerator.cs

示例8: Store

        private void Store(IObjectContainer objectContainer)
        {
            Item item = new Item();
            item._name = "First";
            item._dateTime = new DateTime(2009,1,14);
            objectContainer.Store(item);

            item = new Item();
            item._name = "Second";
            item._dateTime = new DateTime(2009, 1, 15);
            objectContainer.Store(item);
        }
开发者ID:erdincay,项目名称:db4o,代码行数:12,代码来源:CreateDateTimeDatabase.cs

示例9: Store

        private void Store(IObjectContainer objectContainer)
        {
            Item item = new Item();
            item._name = "First";
            item._enumAsInteger = EnumAsInteger.First;
            objectContainer.Store(item);

            item = new Item();
            item._name = "Second";
            item._enumAsInteger = EnumAsInteger.Second;
            objectContainer.Store(item);
        }
开发者ID:Galigator,项目名称:db4o,代码行数:12,代码来源:CreateEnumDatabase.cs

示例10: StoreCars

		public static void StoreCars(IObjectContainer db)
		{
			Pilot pilot1 = new Pilot("Michael Schumacher", 100);
			Car car1 = new Car("Ferrari");
			car1.Pilot = pilot1;
			car1.Snapshot();
			db.Store(car1);
			Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
			Car car2 = new Car("BMW");
			car2.Pilot = pilot2;
			car2.Snapshot();
			car2.Snapshot();
			db.Store(car2);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:14,代码来源:EvaluationExample.cs

示例11: StoreInitialObjects

        // #end example:

        private void StoreInitialObjects(IObjectContainer container)
        {
            dataLock.EnterWriteLock();
            try
            {
                container.Store(new Person("Joe"));
                container.Store(new Person("Jan"));
                container.Store(new Person("Joanna"));
                container.Store(new Person("Phil"));
            }
            finally
            {
                dataLock.ExitWriteLock();
            }
        }
开发者ID:Galigator,项目名称:db4o,代码行数:17,代码来源:ReadWriteLockingOperations.cs

示例12: alterarStatus

        public Boolean alterarStatus(clsStatus objAtualizar)
        {
            try
            {
                if (!temDuplicidade(objAtualizar, "Alterar"))
                {
                    clsStatus objStatusBuscar = new clsStatus();

                    objStatusBuscar.Codigo = objAtualizar.Codigo;
                    db = ServidorSingleton.obterServidor().OpenClient();
                    IObjectSet leitor = db.QueryByExample(objStatusBuscar);

                    clsStatus objStatus = (clsStatus)leitor.Next();
                    objStatus.Descricao = objAtualizar.Descricao;
                    db.Store(objStatus);
                    db.Commit();
                    db.Close();
                    db.Dispose();
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Erro atualizando o status :" + ex.ToString());
            }
        }
开发者ID:fbsharp,项目名称:Projetos,代码行数:30,代码来源:StatusDAO.cs

示例13: StoreData

 private static void StoreData(IObjectContainer container, Random rnd)
 {
     for (int i = 0; i < rnd.Next(4096); i++)
     {
         container.Store(new DataObject(rnd));
     }
 }
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:FreespaceMonitoring.cs

示例14: SetSecondCar

 public static void SetSecondCar(IObjectContainer db)
 {
     Pilot pilot = new Pilot("Michael Schumacher", 100);
     Car car = new Car("Ferrari");
     car.Pilot = pilot;
     db.Store(car);
 }
开发者ID:erdincay,项目名称:db4o,代码行数:7,代码来源:ClientServerExample.cs

示例15: StoreFirstCar

 public static void StoreFirstCar(IObjectContainer db)
 {
     Car car1 = new Car("Ferrari");
     Pilot pilot1 = new Pilot("Michael Schumacher", 100);
     car1.Pilot = pilot1;
     db.Store(car1);
 }
开发者ID:Galigator,项目名称:db4o,代码行数:7,代码来源:StructuredExample.cs


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