コード例 #1
0
 public EntityReferenceValue[] GetFirstPageValues()
 {
     return(RetrieveAllService.Execute(EntityLogicalName).Values
            .Select(k => new EntityReferenceValue()
     {
         Id = k.Id, LogicalName = EntityLogicalName, DisplayName = GetRowDisplayName(k.Values)
     })
            .OrderBy(k => k.DisplayName)
            .ToArray());
 }
コード例 #2
0
 public EntityReferenceValue[] SearchValues(string searchText)
 {
     return(RetrieveAllService.Execute(EntityLogicalName).Values
            .Where(k =>
     {
         if (string.IsNullOrEmpty(searchText))
         {
             return true;
         }
         var name = GetRowDisplayName(k.Values);
         return string.IsNullOrEmpty(name) && name.ToLower().IndexOf(searchText.ToLower()) > -1;
     })
            .Select(k => new EntityReferenceValue()
     {
         Id = k.Id, LogicalName = EntityLogicalName, DisplayName = GetRowDisplayName(k.Values)
     })
            .OrderBy(k => k.DisplayName)
            .ToArray());
 }