本文整理汇总了C#中System.Guid.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# Guid.ToList方法的具体用法?C# Guid.ToList怎么用?C# Guid.ToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Guid
的用法示例。
在下文中一共展示了Guid.ToList方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActiveExtensions
public ActiveExtensions(Guid DriverGuid, Guid GrabberGuid, Guid[] ProcessorGuids,
Guid[] FilterGuids, Guid[] NotifierGuids)
{
this._ActiveProcessors = new List<GlowScreenProcessor>();
this._ActiveFilters = new List<GlowFilter>();
this._ActiveNotifiers = new List<GlowNotifier>();
this.DriverGuid = DriverGuid;
this.GrabberGuid = GrabberGuid;
this.ProcessorGuids = ProcessorGuids.ToList();
this.FilterGuids = FilterGuids.ToList();
this.NotifierGuids = NotifierGuids.ToList();
}
示例2: Post
public ActionResult Post(Guid roleId, Guid[] ids)
{
try
{
_roleFunctionService.Update(roleId, ids.ToList());
return Json(true);
}
catch (Exception e)
{
_logger.Error(e.Message);
_logger.Error(e.StackTrace);
return Json(false);
}
}
示例3: GetByIds
public LeadDto[] GetByIds(Guid[] ids)
{
try
{
using (var transactionScope = new TransactionScope())
{
var employeeDtos = new LeadDtoMapper().Map(_leadRepository.GetByIds(ids.ToList()).ToArray());
transactionScope.Complete();
return employeeDtos;
}
}
finally
{
_sessionProvider.CloseCurrent();
}
}
示例4: GetByIds
public AppointmentDto[] GetByIds(Guid[] ids)
{
try
{
using (var transactionScope = new TransactionScope())
{
var appointmentDtos = new AppointmentDtoMapper().Map(_appointmentRepository.GetByIds(ids.ToList()).ToArray());
transactionScope.Complete();
return appointmentDtos;
}
}
finally
{
_sessionProvider.CloseCurrent();
}
}
示例5: AddSelectedEmployees
public PartialViewResult AddSelectedEmployees(long riskAssessmentId, Guid[] employeeIds)
{
var request = new AddEmployeesToChecklistGeneratorRequest()
{
CompanyId = CurrentUser.CompanyId,
CurrentUserId = CurrentUser.UserId,
EmployeeIds = employeeIds.ToList(),
PersonalRiskAssessmentId = riskAssessmentId
};
_personalRiskAssessmentService.AddEmployeesToChecklistGenerator(request);
var model = _selectedEmployeeViewModelFactory.WithCompanyId(CurrentUser.CompanyId).WithRiskAssessmentId(riskAssessmentId).WithUserId(CurrentUser.UserId)
.GetViewModel();
return PartialView("_EmployeeSelected", model);
}
示例6: GetDependingEntityAccess
public static List<Tuple<Guid, string, List<Tuple<Guid, string>>>> GetDependingEntityAccess(string metaviewName, Guid[] ids, int deep = 1)
{
DynamicEntityRepository repo = new DynamicEntityRepository();
EntityMetadata metadata = repo.GetEntityMetadataByEntityName(metaviewName);
List<Guid> dependingEntityMetadataIds = MetadataRepositoty.GetDependingEntityIds(new TableDescription(metadata.SchemaName, metadata.TableName));
Dictionary<Guid, EntityMetadata> dependingMetadata = dependingEntityMetadataIds.Select(id => new KeyValuePair<Guid, EntityMetadata>(id, repo.GetEntityMetadataByEntityId(id)))
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
var dependingEntities = new List<Tuple<Guid, string, List<Tuple<Guid, string>>>>();
foreach (var entityMetadata in dependingMetadata)
{
FilterCriteriaSet filters = FilterCriteriaSet.Empty;
AttributeDescription entityCaptionAttribute = OptimaJet.BJet.CommonMethods.GetEntityCaptionAttribute(entityMetadata.Value);
List<FilterCriteriaSet> filterSets = entityMetadata.Value.PlainAttributes.Where(a => a.IsReference && a.ReferencedSchemaName == metadata.SchemaName && a.ReferencedTableName == metadata.TableName)
.Select(a => FilterCriteriaSet.And.In(ids.ToList(), entityMetadata.Value.GetColumn(a))).ToList();
filterSets.ForEach(f => filters = filters != FilterCriteriaSet.Empty ? filters.Merge(f) : f);
var entities = repo.GetEntitiesByMetadata(entityMetadata.Value, filters).Entities;
if (entities == null || entities.Count() == 0)
continue;
var dependingEntity = new Tuple<Guid, string, List<Tuple<Guid, string>>>(
entityMetadata.Key,
entityMetadata.Value.TableName,
new List<Tuple<Guid, string>>(entities.Select(e =>
new Tuple<Guid, string>((Guid)e.Id, e.GetProperty(entityCaptionAttribute.PropertyName).ToString())
).ToList()));
dependingEntities.Add(dependingEntity);
if (deep > 0)
dependingEntities.AddRange(GetDependingEntityAccess(dependingEntity.Item2, dependingEntity.Item3.Select(t => t.Item1).ToArray(), deep - 1));
}
return dependingEntities;
}
示例7: OnDeleteRows
protected override void OnDeleteRows(Guid[] checkedRecords)
{
string entityName = LocalizationProvider.Provider.GetMetaEntiryName();
var objs = DynamicRepository.GetByEntity(entityName, FilterCriteriaSet.And.In(checkedRecords.ToList(), "Id"));
List<string> keys = new List<string>();
foreach(var obj in objs)
{
if(!keys.Contains(obj.Key))
keys.Add(obj.Key);
}
DynamicRepository.DeleteByEntity(entityName,
DynamicRepository.GetByEntity(entityName, FilterCriteriaSet.And.In(keys, "Key")).Select(c=> c.Id).ToList());
}
示例8: 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);
}
}
示例9: ExceptionsDeleteList
public ActionResult ExceptionsDeleteList(string log, Guid[] ids, bool returnCounts = false)
{
if (ids == null || ids.Length == 0) return Json(true);
ExceptionStores.Action(log, s => s.DeleteErrors(log, ids.ToList()));
return returnCounts ? ExceptionCounts() : Json(new { url = Url.Action("Exceptions", new { log }) });
}