public IEnumerable Handle(Func <Guid, ParticipantAggregate> al, AddCoachToTeam command) { var agg = al(command.Id); if (agg.TeamId != command.TeamId) { yield return new CoachAssignedToTeam { Id = command.Id, TeamId = command.TeamId, Name = agg.Name } } ; }
public JsonResult AssignCoachToTeam(AddCoachToTeam command) { Domain.Dispatcher.SendCommand(command); return(Json(command)); }