Beispiel #1
0
        public Member Add(string firebaseId, string email, string displayName)
        {
            var member = GenerateMember(firebaseId, email, displayName);

            _memberDataService.Add(member);

            return(_mapper.Map <Member>(member));
        }
Beispiel #2
0
        public IMemberService Add(MemberModel model)
        {
            if (model.TmMemberId.HasValue &&
                _dataService.AllMembers().Any(m => m.TmMemberNumber == model.TmMemberId.Value))
            {
                throw new DuplicateKeyException("TmMemberNumber", "Member");
            }

            var entity = new Member {
                TmMemberNumber = model.TmMemberId,
                TmMemberName   = $"{model.FirstName} {model.LastName}",
                FirstName      = model.FirstName,
                LastName       = model.LastName,
                PrimaryEmail   = model.PrimaryEmail
            };

            _dataService.Add(entity);
            return(this);
        }