-
-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated AppVeyor config to Visual Studio 2019
Added missing DateRange Added VSCode tasks.json
- Loading branch information
1 parent
7beb264
commit 364fdbb
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "shell", | ||
"args": [ | ||
"build", | ||
// Ask dotnet build to generate full paths for file names. | ||
"/property:GenerateFullPaths=true", | ||
// Do not generate summary otherwise it leads to duplicate errors in Problems panel | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"group": "build", | ||
"presentation": { | ||
"reveal": "silent" | ||
}, | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
30 changes: 30 additions & 0 deletions
30
Workshop/02-EventSourcingAdvanced/MeetingsManagement/Meetings/ValueObjects/DateRange.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
|
||
namespace MeetingsManagement.Meetings.ValueObjects | ||
{ | ||
public class DateRange | ||
{ | ||
public DateTime Start { get; } | ||
public DateTime End { get; } | ||
|
||
public DateRange(DateTime start, DateTime end) | ||
{ | ||
Start = start; | ||
End = end; | ||
} | ||
|
||
public static DateRange Create(DateTime start, DateTime end) | ||
{ | ||
if (start == default(DateTime)) | ||
throw new ArgumentException($"{nameof(start)} needs to be defined."); | ||
|
||
if (end == default(DateTime)) | ||
throw new ArgumentException($"{nameof(end)} needs to be defined."); | ||
|
||
if (start > end) | ||
throw new ArgumentException($"{nameof(start)} needs to be earlier or equal {nameof(end)}."); | ||
|
||
return new DateRange(start, end); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters