예제 #1
0
        public async Task <string> Handle(CreateTeamCommand request, CancellationToken cancellationToken)
        {
            var adminMember = new MemberEntity(_currentUserService.UserId, true);
            var team        = TeamAggregate.CreateNew(await _teamRepository.NextIdAsync(), request.Name, adminMember);
            await _teamRepository.SetAsync(team);

            return(team.Id.ToString());
        }
예제 #2
0
 public void create_team_without_admin_should_throw()
 {
     Assert.Throws <DomainException>(() => { TeamAggregate.CreateNew(_teamId, _teamName, GetCommonMember()); });
 }