當前位置: 首頁>>代碼示例>>C#>>正文


C# Guid.TransformToValueForEsentSorting方法代碼示例

本文整理匯總了C#中System.Guid.TransformToValueForEsentSorting方法的典型用法代碼示例。如果您正苦於以下問題:C# Guid.TransformToValueForEsentSorting方法的具體用法?C# Guid.TransformToValueForEsentSorting怎麽用?C# Guid.TransformToValueForEsentSorting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Guid的用法示例。


在下文中一共展示了Guid.TransformToValueForEsentSorting方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Read

		public IEnumerable<ListItem> Read(string name, Guid start, int take)
		{
			Api.JetSetCurrentIndex(session, Lists, "by_name_and_etag");
			Api.MakeKey(session, Lists, name, Encoding.Unicode, MakeKeyGrbit.NewKey);
			Api.MakeKey(session, Lists, start.TransformToValueForEsentSorting(), MakeKeyGrbit.None);
			if (Api.TrySeek(session, Lists, SeekGrbit.SeekGT) == false)
				yield break;
			int count = 0;
			do
			{
				var nameFromDb = Api.RetrieveColumnAsString(session, Lists, tableColumnsCache.ListsColumns["name"], Encoding.Unicode);
				if(string.Equals(name, nameFromDb, StringComparison.InvariantCultureIgnoreCase) == false)
					yield break;

				count++;

				var etag = Api.RetrieveColumn(session, Lists, tableColumnsCache.ListsColumns["etag"]).TransfromToGuidWithProperSorting();
				using (Stream stream = new BufferedStream(new ColumnStream(session, Lists, tableColumnsCache.ListsColumns["data"])))
				{
					yield return new ListItem
					{
						Etag = etag,
						Data = stream.ToJObject(),
						Key = Api.RetrieveColumnAsString(session, Lists, tableColumnsCache.ListsColumns["key"], Encoding.Unicode)
					};
				}
			} while (Api.TryMoveNext(session, Lists) && count < take);
		
		}
開發者ID:fschwiet,項目名稱:ravendb,代碼行數:29,代碼來源:Lists.cs

示例2: RemoveAllBefore

		public void RemoveAllBefore(string name, Guid etag)
		{
			Api.JetSetCurrentIndex(session, Lists, "by_name_and_etag");
			Api.MakeKey(session, Lists, name, Encoding.Unicode, MakeKeyGrbit.NewKey);
			Api.MakeKey(session, Lists, etag.TransformToValueForEsentSorting(), MakeKeyGrbit.None);
			if (Api.TrySeek(session, Lists, SeekGrbit.SeekLE) == false)
				return;
			do
			{
				var nameFromDb = Api.RetrieveColumnAsString(session, Lists, tableColumnsCache.ListsColumns["name"], Encoding.Unicode);
				if (string.Equals(name, nameFromDb, StringComparison.InvariantCultureIgnoreCase) == false)
					break;

				Api.JetDelete(session, Lists);

			} while (Api.TryMovePrevious(session, Lists));

		}
開發者ID:fschwiet,項目名稱:ravendb,代碼行數:18,代碼來源:Lists.cs

示例3: GetAttachmentsAfter

		public IEnumerable<AttachmentInformation> GetAttachmentsAfter(Guid etag)
		{
			Api.JetSetCurrentIndex(session, Files, "by_etag");
			Api.MakeKey(session, Files, etag.TransformToValueForEsentSorting(), MakeKeyGrbit.NewKey);
			if (Api.TrySeek(session, Files, SeekGrbit.SeekGT) == false)
				yield break;
			do
			{
				yield return new AttachmentInformation
				{
					Size = Api.RetrieveColumnSize(session, Files, tableColumnsCache.FilesColumns["data"]).Value,
					Etag = Api.RetrieveColumn(session, Files, tableColumnsCache.FilesColumns["etag"]).TransfromToGuidWithProperSorting(),
					Key = Api.RetrieveColumnAsString(session, Files, tableColumnsCache.FilesColumns["name"], Encoding.UTF8),
					Metadata = JObject.Parse(Api.RetrieveColumnAsString(session, Files, tableColumnsCache.FilesColumns["metadata"], Encoding.Unicode))
				};
			} while (Api.TryMoveNext(session, Files));
		}
開發者ID:dplaskon,項目名稱:ravendb,代碼行數:17,代碼來源:Attachments.cs

示例4: UpdateLastIndexed

		public void UpdateLastIndexed(string index, Guid etag, DateTime timestamp)
		{
			SetCurrentIndexStatsTo(index);
			using(var update = new Update(session, IndexesStats, JET_prep.Replace))
			{
				Api.SetColumn(session, IndexesStats,
				              tableColumnsCache.IndexesStatsColumns["last_indexed_etag"],
				              etag.TransformToValueForEsentSorting());
				Api.SetColumn(session, IndexesStats,
							  tableColumnsCache.IndexesStatsColumns["last_indexed_timestamp"],
							  timestamp);
				update.Save();
			}
		}
開發者ID:andrewdavey,項目名稱:ravendb,代碼行數:14,代碼來源:Indexing.cs

示例5: GetFilesAfter

		public IEnumerable<FileHeader> GetFilesAfter(Guid etag, int take)
		{
			Api.JetSetCurrentIndex(session, Files, "by_etag");
			Api.MakeKey(session, Files, etag.TransformToValueForEsentSorting(), MakeKeyGrbit.NewKey);
			if (Api.TrySeek(session, Files, SeekGrbit.SeekGT) == false)
				return Enumerable.Empty<FileHeader>();

			var result = new List<FileHeader>();
			var index = 0;

			do
			{
				result.Add(new FileHeader
					           {
						           Name =
							           Api.RetrieveColumnAsString(session, Files, tableColumnsCache.FilesColumns["name"], Encoding.Unicode),
						           TotalSize = GetTotalSize(),
						           UploadedSize =
							           BitConverter.ToInt64(
								           Api.RetrieveColumn(session, Files, tableColumnsCache.FilesColumns["uploaded_size"]), 0),
						           Metadata = RetrieveMetadata()
					           });
			} while (++index < take && Api.TryMoveNext(session, Files));

			return result;
		}
開發者ID:hibernating-rhinos,項目名稱:RavenFS,代碼行數:26,代碼來源:StorageActionsAccessor.cs

示例6: GetAttachmentsAfter

		public IEnumerable<AttachmentInformation> GetAttachmentsAfter(Guid etag, int take)
		{
			Api.JetSetCurrentIndex(session, Files, "by_etag");
			Api.MakeKey(session, Files, etag.TransformToValueForEsentSorting(), MakeKeyGrbit.NewKey);
			if (Api.TrySeek(session, Files, SeekGrbit.SeekGT) == false)
				return Enumerable.Empty<AttachmentInformation>();

			var optimizer = new OptimizedIndexReader(Session, Files, take);
			do
			{
				optimizer.Add();
			} while (Api.TryMoveNext(session, Files) && optimizer.Count < take);

			return optimizer.Select(() => new AttachmentInformation
			{
				Size = Api.RetrieveColumnSize(session, Files, tableColumnsCache.FilesColumns["data"]) ?? 0,
				Etag = Api.RetrieveColumn(session, Files, tableColumnsCache.FilesColumns["etag"]).TransfromToGuidWithProperSorting(),
				Key = Api.RetrieveColumnAsString(session, Files, tableColumnsCache.FilesColumns["name"], Encoding.Unicode),
				Metadata = RavenJObject.Parse(Api.RetrieveColumnAsString(session, Files, tableColumnsCache.FilesColumns["metadata"], Encoding.Unicode))
			});
		}
開發者ID:seankearon,項目名稱:ravendb,代碼行數:21,代碼來源:DocumentStorageActions.cs

示例7: GetAttachmentsAfter

		public IEnumerable<AttachmentInformation> GetAttachmentsAfter(Guid etag, int take, long maxTotalSize)
		{
			Api.JetSetCurrentIndex(session, Files, "by_etag");
			Api.MakeKey(session, Files, etag.TransformToValueForEsentSorting(), MakeKeyGrbit.NewKey);
			if (Api.TrySeek(session, Files, SeekGrbit.SeekGT) == false)
				return Enumerable.Empty<AttachmentInformation>();

			var optimizer = new OptimizedIndexReader(Session, Files, take);
			do
			{
				optimizer.Add();
			} while (Api.TryMoveNext(session, Files) && optimizer.Count < take);

			long totalSize = 0;

			return optimizer
				.Where(_ => totalSize <= maxTotalSize)
				.Select(o => ReadCurrentAttachmentInformation())
				.Select(x=>
				{
					totalSize += x.Size;
					return x;
				});
		}
開發者ID:remcoros,項目名稱:ravendb,代碼行數:24,代碼來源:DocumentStorageActions.cs

示例8: UpdateLastReduced

		public void UpdateLastReduced(string index, Guid etag, DateTime timestamp)
		{
			Api.JetSetCurrentIndex(session, IndexesStatsReduce, "by_key");
			Api.MakeKey(session, IndexesStatsReduce, index, Encoding.Unicode, MakeKeyGrbit.NewKey);
			if (Api.TrySeek(session, IndexesStatsReduce, SeekGrbit.SeekEQ) == false)
				throw new IndexDoesNotExistsException("There is no reduce index named: " + index);

			using (var update = new Update(session, IndexesStatsReduce, JET_prep.Replace))
			{
				Api.SetColumn(session, IndexesStatsReduce,
							  tableColumnsCache.IndexesStatsReduceColumns["last_reduced_etag"],
							  etag.TransformToValueForEsentSorting());
				Api.SetColumn(session, IndexesStatsReduce,
							  tableColumnsCache.IndexesStatsReduceColumns["last_reduced_timestamp"],
							  timestamp.ToBinary());
				update.Save();
			}
		}
開發者ID:nberardi,項目名稱:ravendb,代碼行數:18,代碼來源:Indexing.cs

示例9: GetDocumentsAfter

        public IEnumerable<JsonDocument> GetDocumentsAfter(Guid etag)
        {
            Api.JetSetCurrentIndex(session, Documents, "by_etag");
        	Api.MakeKey(session, Documents, etag.TransformToValueForEsentSorting(), MakeKeyGrbit.NewKey);
            if(Api.TrySeek(session, Documents, SeekGrbit.SeekGT)==false)
                yield break;
            do
            {
            	var data = Api.RetrieveColumn(session, Documents, tableColumnsCache.DocumentsColumns["data"]);
            	var key = Api.RetrieveColumnAsString(session, Documents, tableColumnsCache.DocumentsColumns["key"],Encoding.Unicode);
            	var metadata = Api.RetrieveColumn(session, Documents, tableColumnsCache.DocumentsColumns["metadata"]).ToJObject();

				data = documentCodecs.Aggregate(data, (bytes, codec) => codec.Decode(key, metadata, bytes));

            	yield return new JsonDocument
                {
                    Key = key,
                    DataAsJson = data.ToJObject(),
					NonAuthoritiveInformation = IsDocumentModifiedInsideTransaction(key),
					LastModified = Api.RetrieveColumnAsDateTime(session, Documents, tableColumnsCache.DocumentsColumns["last_modified"]).Value,
					Etag = Api.RetrieveColumn(session, Documents, tableColumnsCache.DocumentsColumns["etag"]).TransfromToGuidWithProperSorting(),
                    Metadata = metadata
                };
            } while (Api.TryMoveNext(session, Documents));
        }
開發者ID:Rationalle,項目名稱:ravendb,代碼行數:25,代碼來源:Documents.cs


注:本文中的System.Guid.TransformToValueForEsentSorting方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。