Linq Example
Linq
List<string>
NotStartedCount = statusCollection.AsEnumerable().Where(f => f != null && f.ToUpperInvariant().Contains(TaskActivityStatus.NotStarted.GetDescription().ToUpperInvariant())).Select(d
=> d.ToString()).ToList<string>();
List<string>
CompletedCount = statusCollection.AsEnumerable().Where(f => f != null && f.ToUpperInvariant().Contains(TaskActivityStatus.Complete.GetDescription().ToUpperInvariant())).Select(d
=> d.ToString()).ToList<string>();
pendingSubMapStatusCollection =
activitypendingSubMapCollection.GetDataTable().AsEnumerable().Where(d => d
!= null
&& Convert.ToString(d[ESWTaskActivtiy.TaskActivityStatusInt.GetDescription()],
CultureInfo.InvariantCulture) != null)
.Select(h => Convert.ToString(h[ESWTaskActivtiy.TaskActivityStatusInt.GetDescription()],
CultureInfo.InvariantCulture)).ToList<string>();
List<string>
discUser = GetUsers.AsEnumerable().Where(d => d != null
&& employeetable.AsEnumerable().Any(f => f != null
&& Convert.ToString(f["ClockId"], CultureInfo.InvariantCulture).ToUpperInvariant().Equals(Convert.ToString(d["AccountName"],
CultureInfo.InvariantCulture).ToUpperInvariant())))
.Select(h => Convert.ToString(h["AccountName"], CultureInfo.InvariantCulture)).ToList<string>();
No comments:
Post a Comment