コード例 #1
0
    private async Task <bool> Handle(TeamAdded evt)
    {
        var team = await _teamQueryHandler.GetTeamAsync(evt.TeamId);

        var teamObj = new Team(team.Id, team.Name);

        var projection = await _projectionManager.GetProjectionAsync(this.GetPrimaryKey());

        await _projectionManager.UpdateProjection(
            this.GetPrimaryKey(),
            projection with {
            Teams = projection.Teams.Add(teamObj)
        });
コード例 #2
0
 public void AddTeam(ITeamClass team)
 {
     _teamList.Add(team);
     TeamListChanged?.Invoke();
     TeamAdded?.Invoke(team);
 }
コード例 #3
0
 public void Apply(TeamAdded evt)
 => Teams.Add(evt.TeamId);