当前位置: 首页>>代码示例>>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;未经允许,请勿转载。