Skip to content

Commit

Permalink
moreof
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Jan 17, 2019
1 parent 40ced17 commit 2cbef43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
15 changes: 4 additions & 11 deletions equinox-web-csharp/Domain/Aggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,15 @@ public static State Fold(State origin, IEnumerable<Event> xs)
}

/// Defines the decision process which maps from the intent of the `Command` to the `Event`s that represent that decision in the Stream
public abstract class Command
public abstract class Command : OneOfBase<Command.MakeItSo>
{
public class MakeItSo : Command
{
}

public static IEnumerable<Event> Interpret(State s, Command x)
{
switch (x)
{
case MakeItSo c:
if (!s.Happened) yield return new Event.Happened();
break;
default: throw new ArgumentOutOfRangeException(nameof(x), x, "invalid");
}
}
public static Event[] Interpret(State s, Command x) =>
x.Match(makeItSo =>
s.Happened ? new Event[0] : new Event [] { new Event.Happened()});
}

class Handler
Expand Down
2 changes: 1 addition & 1 deletion equinox-web-csharp/Domain/Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<LangVersion>7.3</LangVersion>
<LangVersion>7</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Empty file modified equinox-web-csharp/Web/Startup.cs
100755 → 100644
Empty file.

0 comments on commit 2cbef43

Please sign in to comment.