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


C# Guid.Concat方法代码示例

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


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

示例1: Short_byte_arrays_are_not_truncated

        public void Short_byte_arrays_are_not_truncated()
        {
            var shortArray = new Guid("21EC2020-3AEA-4069-A2DD-08002B30309D").ToByteArray();
            var longerShortArray = shortArray.Concat(shortArray).ToArray();

            Assert.Equal("0x2020EC21EA3A6940A2DD08002B30309D", RelationalLoggerExtensions.FormatParameterValue(shortArray));
            Assert.Equal("0x2020EC21EA3A6940A2DD08002B30309D2020EC21EA3A6940A2DD08002B30309D", RelationalLoggerExtensions.FormatParameterValue(longerShortArray));
        }
开发者ID:ChuYuzhi,项目名称:EntityFramework,代码行数:8,代码来源:RelationalLoggerExtensionsTest.cs

示例2: Long_byte_arrays_are_truncated

        public void Long_byte_arrays_are_truncated()
        {
            var shortArray = new Guid("21EC2020-3AEA-4069-A2DD-08002B30309D").ToByteArray();
            var longArray = shortArray.Concat(shortArray).Concat(shortArray).ToArray();

            var builder = new StringBuilder();
            RelationalLoggerExtensions.FormatParameterValue(builder, longArray);

            Assert.Equal("'0x2020EC21EA3A6940A2DD08002B30309D2020EC21EA3A6940A2DD08002B30309D...'", builder.ToString());
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:10,代码来源:RelationalLoggerExtensionsTest.cs

示例3: MultipleOperations_CompletedOperations_Test

        public void MultipleOperations_CompletedOperations_Test()
        {
            IOperationsManager operationsManager = GetOperationsManager();

            int numberOfOperations = 500;
            Guid[] completed = new Guid[numberOfOperations];
            Guid[] running = new Guid[numberOfOperations];
            Guid[] failed = new Guid[numberOfOperations];
            Guid[] canceled = new Guid[numberOfOperations];
            Guid[] pendingCancelation = new Guid[numberOfOperations];
            for (int i = 0; i < numberOfOperations; i++)
            {
                completed[i] = operationsManager.RegistrOperation(OPERATION_DISPLAY_NAME);
                running[i] = operationsManager.RegistrOperation(OPERATION_DISPLAY_NAME);
                failed[i] = operationsManager.RegistrOperation(OPERATION_DISPLAY_NAME);
                canceled[i] = operationsManager.RegistrOperation(OPERATION_DISPLAY_NAME);
                pendingCancelation[i] = operationsManager.RegistrOperation(OPERATION_DISPLAY_NAME);
            }
            foreach (var guid in pendingCancelation)
            {
                operationsManager.SetOperationCancelFlag(guid);
            }
            foreach (var guid in completed)
            {
                operationsManager.SetOperationResult(guid, null);
            }
            foreach (var guid in failed)
            {
                operationsManager.SetOperationFailed(guid, new Exception(FAILURE_REASON));
            }
            foreach (var guid in canceled)
            {
                operationsManager.SetOperationCanceled(guid);
            }
            Guid[] completedOperations = operationsManager.GetCompletedOperations();
            CollectionAssert.AreEquivalent(completed.Concat(failed).Concat(canceled).ToArray(), completedOperations);
        }
开发者ID:huoxudong125,项目名称:WcfEverywhere,代码行数:37,代码来源:IOperationsManager_TestFixture.cs

示例4: RemoveImportQueueRecordRange

 public GuidExecutionResults RemoveImportQueueRecordRange(Guid[] identifiers)
 {
     UpdateSessionCulture();
     using (var logSession = Helpers.Log.Session($"{GetType()}.{System.Reflection.MethodBase.GetCurrentMethod().Name}()", VerboseLog, RaiseLog))
         try
         {
             using (var rep = GetNewRepository(logSession))
             {
                 logSession.Add($"Try to get account import queue records with ids = '{identifiers.Concat(i => i.ToString(), ",")}' from database...");
                 var itemsToRemove = rep.Get<RoyaltyRepository.Models.ImportQueueRecord>(a => identifiers.Contains(a.ImportQueueRecordUID)).ToArray();
                 logSession.Add($"Accounts import queue records found for remove: {itemsToRemove.Length}");
                 rep.RemoveRange(itemsToRemove);
                 rep.SaveChanges();
                 return new GuidExecutionResults(itemsToRemove.Select(i => i.ImportQueueRecordUID).ToArray());
             }
         }
         catch (Exception ex)
         {
             ex.Data.Add(nameof(identifiers), identifiers.Concat(i => i.ToString(),","));
             logSession.Enabled = true;
             logSession.Add(ex);
             return new GuidExecutionResults(ex);
         }
 }
开发者ID:kblc,项目名称:Royalty,代码行数:24,代码来源:AccountService.ImportQueueRecord.cs

示例5: EmployeePhotosRemove

        /// <summary>
        /// Remove photo to employee
        /// </summary>
        /// <param name="employeeId">Employee identifier</param>
        /// <param name="photoIdentifier">Employee photo identifier</param>
        public Model.EmployeePhotoExecutionResults EmployeePhotosRemove(long employeeId, Guid[] photoIdentifiers)
        {
            UpdateSessionCulture();
            using (var logSession = Helpers.Log.Session($"{GetType()}.{System.Reflection.MethodBase.GetCurrentMethod().Name}()", VerboseLog, RaiseLog))
                try
                {
                    var emp = EmployeeGet(employeeId);
                    if (emp.Exception != null)
                        throw emp.Exception;

                    using (var rep = GetNewRepository(logSession))
                    {
                        photoIdentifiers.ToList().ForEach(photoIdentifier => {
                            var dbPhoto = rep.Get<Repository.Model.EmployeePhoto>(e => e.FileId == photoIdentifier).SingleOrDefault();
                            if (dbPhoto == null)
                                throw new Exception(string.Format(Properties.Resources.FILESERVICE_FileNotFound, photoIdentifier));
                            rep.Remove(dbPhoto, saveAfterRemove: false);
                        });
                        rep.SaveChanges(true);
                    }

                    return EmployeePhotosGet(employeeId);
                }
                catch (Exception ex)
                {
                    ex.Data.Add(nameof(employeeId), employeeId);
                    ex.Data.Add(nameof(photoIdentifiers), photoIdentifiers.Concat(i => i.ToString(),", "));
                    logSession.Enabled = true;
                    logSession.Add(ex);
                    return new EmployeePhotoExecutionResults(ex);
                }
        }
开发者ID:kblc,项目名称:Personnel,代码行数:37,代码来源:StuffingService.EmployeePhoto.cs

示例6: GetRange

 /// <summary>
 /// Get file infos by identifiers
 /// </summary>
 /// <param name="identifiers">File info identifiers</param>
 /// <returns>Files info</returns>
 public FileExecutionResults GetRange(Guid[] identifiers)
 {
     UpdateSessionCulture();
     using (var logSession = Helpers.Log.Session($"{GetType()}.{System.Reflection.MethodBase.GetCurrentMethod().Name}()", VerboseLog, RaiseLog))
         try
         {
             using (var rep = GetNewRepository(logSession))
             {
                 var res = rep.Get<RoyaltyRepository.Models.File>(f => identifiers.Contains(f.FileUID))
                     .ToArray()
                     .Select(f => Mapper.Map<Model.File>(f))
                     .ToArray();
                 return new FileExecutionResults(res);
             }
         }
         catch (Exception ex)
         {
             ex.Data.Add(nameof(identifiers), identifiers.Concat(i => i.ToString("N"), ","));
             logSession.Enabled = true;
             logSession.Add(ex);
             return new FileExecutionResults(ex);
         }
 }
开发者ID:kblc,项目名称:Royalty,代码行数:28,代码来源:FileService.cs


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