本文整理汇总了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));
}
示例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());
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}