Ejemplo n.º 1
0
 public MemberAppService(ILogger logger
                         , IMemberUnitOfWork memberUnitOfWork
                         )
 {
     _logger           = logger ?? throw new ArgumentNullException(nameof(memberUnitOfWork));
     _memberUnitOfWork = memberUnitOfWork ?? throw new ArgumentNullException(nameof(memberUnitOfWork));
 }
        public Member CreateNewMember(MemberInfo newMemberInfo)
        {
            Member newMember = new Member
            {
                FullName = newMemberInfo.FullName
            };

            using (IMemberUnitOfWork uow = _uowFactory.GetMemberUnitOfWork())
            {
                uow.InsertNewMember(newMember);
                uow.Save();
            }

            return(newMember);
        }