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


C# IObjectContainer.Ext方法代码示例

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


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

示例1: Read

 public static IEnumerable<ITypeDescription> Read(IObjectContainer database,
     TypeResolver typeResolver)
 {
     new {database, typeResolver}.CheckNotNull();
     var reader = new MetaDataReader(typeResolver, ExtractStoredClasses(database.Ext().StoredClasses()));
     return reader.CreateTypes(database.Ext()).ToList();
 }
开发者ID:gamlerhart,项目名称:db4opad,代码行数:7,代码来源:MetaDataReader.cs

示例2: ObjectDetails

        public ObjectDetails(long id)
        {
        	this.id = id;
			objectContainer = Db4oClient.Client;
        	m_genObject = objectContainer.Ext().GetByID(id);
        	objectContainer.Ext().Activate(m_genObject, 1);
           
        }
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:ObjectDetails.cs

示例3: TraverseIndex

 private static void TraverseIndex(IObjectContainer container)
 {
     // #example: Traverse index
     IStoredField storedField = container.Ext()
         .StoredClass(typeof (Item)).StoredField("data", typeof (int));
     storedField.TraverseValues(new IndexVisitor());
     // #end example
 }
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:TraverseIndexExample.cs

示例4: IndexDatabase

 private void IndexDatabase(IndexWriter writer, IObjectContainer container)
 {
     IEnumerable<Versiculo> versiculos = container.Query<Versiculo>();
     foreach(Versiculo versiculo in versiculos){
         Document doc = CreateVersiculoDoc(container.Ext().GetID(versiculo), versiculo);
         writer.AddDocument(doc); 
     }
 }
开发者ID:abibliafalada,项目名称:abibliafalada-v2,代码行数:8,代码来源:Index.cs

示例5: ListRefreshedResult

		public static void ListRefreshedResult(IObjectContainer container, IObjectSet items, int depth)
		{
			Console.WriteLine(items.Count);
			foreach (object item in items)
			{	
				container.Ext().Refresh(item, depth);
				Console.WriteLine(item);
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:Util.cs

示例6: Refresh

 private static void Refresh(IObjectContainer db, IList<Person> allPersons)
 {
     foreach (Person objToRefresh in allPersons)
     {
         // #example: refresh a object
         db.Ext().Refresh(objToRefresh, int.MaxValue);
         // #end example
     }
 }
开发者ID:Galigator,项目名称:db4o,代码行数:9,代码来源:RefreshingObjects.cs

示例7: RunWith

			public void RunWith(IObjectContainer db)
			{
				IStoredClass storedClass = db.Ext().StoredClass(targetClazz);
				IStoredField storedField = storedClass.StoredField(fieldName, fieldType);
				IObjectSet result = db.Query(targetClazz);
				Assert.AreEqual(1, result.Count);
				object obj = result.Next();
				object value = (object)storedField.Get(obj);
				Assert.AreEqual(fieldValue, value);
			}
开发者ID:superyfwy,项目名称:db4o,代码行数:10,代码来源:AccessFieldTestCaseBase.cs

示例8: StoreInitialObjects

        // #end example:

        private void StoreInitialObjects(IObjectContainer rootContainer)
        {
            using (IObjectContainer container = rootContainer.Ext().OpenSession())
            {
                container.Store(new Person("Joe"));
                container.Store(new Person("Jan"));
                container.Store(new Person("Joanna"));
                container.Store(new Person("Phil"));
            }
        }
开发者ID:superyfwy,项目名称:db4o,代码行数:12,代码来源:UnitsOfWork.cs

示例9: ListAllPeople

 // #example: An object container for this unit of work
 private void ListAllPeople(IObjectContainer rootContainer)
 {
     using (IObjectContainer container = rootContainer.Ext().OpenSession())
     {
         foreach (Person person in from Person p in container select p)
         {
             Console.WriteLine(person.Name);
         }
     }
 }
开发者ID:superyfwy,项目名称:db4o,代码行数:11,代码来源:UnitsOfWork.cs

示例10: CarSnapshotRollbackRefresh

 public static void CarSnapshotRollbackRefresh(IObjectContainer db)
 {
     IObjectSet result=db.QueryByExample(new Car("BMW"));
     Car car=(Car)result.Next();
     car.Snapshot();
     db.Store(car);
     db.Rollback();
     db.Ext().Refresh(car, int.MaxValue);
     Console.WriteLine(car);
 }
开发者ID:Galigator,项目名称:db4o,代码行数:10,代码来源:TransactionExample.cs

示例11: Db4oEmbeddedReplicationProvider

		public Db4oEmbeddedReplicationProvider(IObjectContainer objectContainer, string name
			)
		{
			// TODO: Add additional query methods (whereModified )
			IConfiguration cfg = objectContainer.Ext().Configure();
			cfg.Callbacks(false);
			_name = name;
			_container = (ExternalObjectContainer)objectContainer;
			_reflector = _container.Reflector();
			_signatureMap = new Db4oSignatureMap(_container);
			_activationStrategy = CreateActivationStrategy();
		}
开发者ID:erdincay,项目名称:db4o,代码行数:12,代码来源:Db4oEmbeddedReplicationProvider.cs

示例12: RefreshAfterRollback

        private static void RefreshAfterRollback(IObjectContainer container)
        {
            // #example: Refresh objects after rollback
            Pilot pilot = container.Query<Pilot>()[0];
            pilot.Name = "New Name";
            container.Store(pilot);
            container.Rollback();

            // use refresh to return the in memory objects back
            // to the state in the database.
            container.Ext().Refresh(pilot, int.MaxValue);
            // #end example
        }
开发者ID:Galigator,项目名称:db4o,代码行数:13,代码来源:Transactions.cs

示例13: UpdateSomePeople

        // #end example

        // #example: An object container for the background task
        private void UpdateSomePeople(IObjectContainer rootContainer)
        {
            using (IObjectContainer container = rootContainer.Ext().OpenSession())
            {
                var people = from Person p in container
                             where p.Name.Equals("Joe")
                             select p;
                foreach (Person joe in people)
                {
                    joe.Name = "New Joe";
                    container.Store(joe);
                }
            }
        }
开发者ID:superyfwy,项目名称:db4o,代码行数:17,代码来源:UnitsOfWork.cs

示例14: AssertChangesHaveBeenStored

 private void AssertChangesHaveBeenStored(IObjectContainer container)
 {
     var session = container.Ext().OpenSession();
     try
     {
         var item = ((NamedItem
             ) session.Query(typeof (NamedItem))[0]);
         Assert.AreEqual("New Name", item.GetName());
     }
     finally
     {
         session.Close();
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:14,代码来源:CommitTimeStampsWithTPTestCase.cs

示例15: AssertChangesHaveBeenStored

		private void AssertChangesHaveBeenStored(IObjectContainer container)
		{
			IObjectContainer session = container.Ext().OpenSession();
			try
			{
				CommitTimeStampsWithTPTestCase.NamedItem item = ((CommitTimeStampsWithTPTestCase.NamedItem
					)session.Query(typeof(CommitTimeStampsWithTPTestCase.NamedItem))[0]);
				Assert.AreEqual("New Name", item.GetName());
			}
			finally
			{
				session.Close();
			}
		}
开发者ID:Galigator,项目名称:db4o,代码行数:14,代码来源:CommitTimeStampsWithTPTestCase.cs


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