示例#1
0
        public void AddMember(MemberRegistrationInfo memberRegistrationInfo)
        {
            var entityToAdd = new MemberEntity()
            {
                Name    = memberRegistrationInfo.Name,
                Surname = memberRegistrationInfo.Surname,
                Mail    = memberRegistrationInfo.Mail
            };

            if (this.memberRepository.Contains(entityToAdd))
            {
                throw new ArgumentException("This member has been registered. Can't continue");
            }

            this.memberRepository.Add(entityToAdd);
            this.memberRepository.Save();
        }
 public void Post([FromBody] MemberRegistrationInfo value)
 {
     memberService.AddMember(value);
 }