Skip to content

Commit

Permalink
foreach examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ewdlop committed Mar 24, 2024
1 parent 929ed86 commit a0bbcdd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@
.WithAdd(new { Label = "label", Number = 41 })
.Build();

for (int i = 0; i < patchOperationList.Count; i++)
{
Console.WriteLine(patchOperationList[i]);
}

foreach (var patchOperation in patchOperationList)
{
Console.WriteLine(patchOperation);
}

patchOperationList.Select(patchOperation => patchOperation.Path).ToList().ForEach(Console.WriteLine);

patchOperationList.ForEach(Console.WriteLine);

//Not done yet
namespace CosmosDBPartialUpdateTypeConverter
{
Expand Down Expand Up @@ -162,6 +176,8 @@ public void AddSet<T>(params T[] entities)
public IEnumerator<PatchOperation> GetEnumerator() => _patchOperations.GetEnumerator();

IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();

public void ForEach(Action<PatchOperation> action) => _patchOperations.ForEach(action);
}

public static class PatchOperationExtension
Expand Down

0 comments on commit a0bbcdd

Please sign in to comment.