List of LinQ queries
- Aggregate:
- Select Many:
- For Each:
- Order By:
- Join:
- Select New:
- Group By:
- TakeWhile
IEnumerable:
1 2 | var errors = Error.Aggregate("Error occured: ", (current, error) => current + $"Code - {error.Code}, Detail - {error.Text}; "); |
|
Parallel.ForEach(Categories,
Category =>
{
Logger.Log(
Category.Id);
};
parameters.ToList().ForEach(x => command.Parameters.Add(x));
foreach (var node in xnode.Descendants("node1"))
{
node.Nodes().ToList().ForEach(n => n.Remove());
}data.OrderBy(s => s.date).ToArray();
$"{Error} (Description: {string.Join(", ", ErrorCodes?.Select(e => e.ToString()))}"; var amount = from a in price.LineItems join b in discount.LineItems on a.Id equals b.Id where (a.amount ?? 0)) > b.amount) select new { a, b };
return (from cat in result.Cast<dynamic>() group cat by cat.Id into bycat let subcat = from region in bycat group region by region.Region into byRegion let subsubcat = from code in byRegion group code by code.Code into byCode select (string)byCode.Key select new { Name = (string)byRegion.Key, Codes = subsubcat.ToList() } select new Cat<string> { Name = byCat.Key, Regions = subcat.ToDictionary(r => r.Name, r => r.Codes, StringComparer.InvariantCultureIgnoreCase) }).ToDictionary(c => c.Name, c => c, StringComparer.InvariantCultureIgnoreCase); } select new Info((new[] { cat.Select(lineItem => lineItem.LineItem).ToList() }) .ToList() .ForEach(Infos.Add);
foreach (var grpCat in items.GroupBy(cat => cat.Id)) { }
foreach (var cat in categories.TakeWhile(esi => categories == null)) { }
1 2 3 4 5 6 7 8 9 10 11 12 13 | using System.Collections.Generic; namespace Web.Models { public static class Class { IEnumerable<CatInfo> data; if (TryExecuteQuery(out data, "GetData", parameters)) { info = data.ToList(); } } } |
No comments:
Post a Comment