示例#1
0
        public async Task <ActionResult <Envelope <ApplicantResponse> > > RemoveApplicant(int applicantId)
        {
            var removeApplicant = await _applicantService.RemoveApplicant(applicantId);

            if (removeApplicant.IsSuccess)
            {
                return(Ok(Envelope.Ok(ApplicantResponse.Map(removeApplicant.Value))));
            }

            return(BadRequest(Envelope.Error(removeApplicant.Error)));
        }
示例#2
0
        public async Task <ActionResult <Envelope <ApplicantResponse> > > ModifyApplicant(int applicantId,
                                                                                          [FromBody] ApplicantDto dto)
        {
            var modifyApplicant = await _applicantService.ModifyApplicant(applicantId, dto);

            if (modifyApplicant.IsSuccess)
            {
                return(Ok(Envelope.Ok(ApplicantResponse.Map(modifyApplicant.Value))));
            }

            return(BadRequest(Envelope.Error(modifyApplicant.Error)));
        }
示例#3
0
        public async Task <ActionResult <Envelope <ApplicantResponse> > > RegisterApplicant([FromBody] ApplicantDto dto)
        {
            var registerApplicant = await _applicantService.RegisterApplicant(dto);

            if (registerApplicant.IsSuccess)
            {
                return(CreatedAtAction(nameof(GetApplicant),
                                       new { applicantId = registerApplicant.Value.Id },
                                       Envelope.Ok(ApplicantResponse.Map(registerApplicant.Value))));
            }

            return(BadRequest(Envelope.Error(registerApplicant.Error)));
        }