Esempio n. 1
0
        public async Task <ActionResult <Member> > Post([FromBody] CreateMemberRequest request)
        {
            CreateMemberRequestResult result = await _membersService.CreateAsync(request);

            if (!result.WasSuccessful)
            {
                ModelState.AddErrorListToModelState(result.Errors);
                return(BadRequest(ModelState));
            }

            return(CreatedAtAction(nameof(Get), null, result.Member));
        }
        private async Task CreateAsync()
        {
            var member = GetMember();

            await _membersService.CreateAsync(member).ConfigureAwait(true);
        }