Skip to content

Commit 351b809

Browse files
committed
- ISystemClock
1 parent d31b5f2 commit 351b809

4 files changed

Lines changed: 30 additions & 4 deletions

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@ PM> Install-Package Shuttle.Core.System
66

77
OS and system level abstractions.
88

9+
## ISystemClock
10+
11+
The default implementation is `SystemClock`.
12+
13+
``` c#
14+
DateTimeOffset UtcNow { get; }
15+
```
16+
17+
Return the `DataTimeOffset` as the current UTC data/time.
18+
919
## IEnvironmentService
1020

11-
The default implement is `EnvironmentService`.
21+
The default implementation is `EnvironmentService`.
1222

1323
``` c#
1424
bool UserInteractive { get; }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System;
2+
3+
namespace Shuttle.Core.System
4+
{
5+
public interface ISystemClock
6+
{
7+
DateTimeOffset UtcNow { get; }
8+
}
9+
}

Shuttle.Core.System/SystemClock.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System;
2+
3+
namespace Shuttle.Core.System
4+
{
5+
public class SystemClock : ISystemClock
6+
{
7+
public DateTimeOffset UtcNow => DateTimeOffset.UtcNow;
8+
}
9+
}

Shuttle.Core.System/SystemProcess.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ public class SystemProcess : IProcess
99

1010
public SystemProcess(Process process)
1111
{
12-
Guard.AgainstNull(process, nameof(process));
13-
14-
_process = process;
12+
_process = Guard.AgainstNull(process, nameof(process));
1513
}
1614

1715
public void Kill()

0 commit comments

Comments
 (0)