Skip to content

Commit

Permalink
Added the Inclusive extension for range.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simnico99 committed Jan 25, 2023
1 parent 04bfd13 commit c39b538
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ZirconNet.Core/Extensions/RangeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ public static CustomIntEnumerator GetEnumerator(this Range range)
#else
internal static CustomIntEnumerator GetEnumerator(this Range range)
#endif
{
{
return new CustomIntEnumerator(range);
}

#if NETCOREAPP3_1_OR_GREATER
public static Range Inclusive(this Range range)
#else
internal static Range Inclusive(this Range range)
#endif
{
return new Range(range.Start, range.End.Value + 1);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using ZirconNet.Core.Extensions;

namespace ZirconNet.Core.Hosting;
public static class AddBackgroundServiceExtension
Expand Down

0 comments on commit c39b538

Please sign in to comment.