public void CreateSquad(string squadId, string squadLeader, int numberOfSquadMembers, string sport) { var result = _squadService.FindSquad(squadId); if (result == null) { Squad squa = new Squad() { SquadId = squadId, SquadLeader = squadLeader, NoOfSquadMembers = numberOfSquadMembers, Sport = sport }; _squadService.AddSquad(squa); _squadService.SaveSquad(); } }
public void CreateSquadMember(string memberId, string squadId) { var result1 = _memberService.FindMember(memberId); var result2 = _squadService.FindSquad(squadId); if (result1 != null && result2 != null) { SquadMembers squaMember = new SquadMembers() { SquadMemberId = $"{memberId}-{squadId}", MemberId = memberId, SquadId = squadId }; _squadMemberService.AddSquadMember(squaMember); _squadMemberService.SaveSquadMember(); } }