Esempio n. 1
0
        public ActionResult AddMember(MemberJoinRequest joinRequest)
        {
            var validation = _Validator.Validate(joinRequest);

            if (!validation.IsValid)
            {
                return(BadRequest(new { error = validation.ErrorMessage }));
            }
            var newMember = new Member(joinRequest);

            _Members.AddNewMember(newMember);

            return(Created($"api/members/{newMember.Id}", newMember));
        }