示例#1
0
 public async Task <Freelancer> CreateFreelancerAsync(FreelancerCreation newFreelancerData)
 {
     return(_mapper.Map <Models.Freelancer>(
                await _contactCommand.CreateContactAsync(
                    _mapper.Map <Database.Entities.Contact>(newFreelancerData))));
 }
        public async Task <ActionResult <DTO.Response.Employee> > CreateFreelancerAsync([FromBody] FreelancerCreation newFreelancerData)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var newFreelancer = await _contactService.CreateFreelancerAsync(newFreelancerData);

            return(Created($"contacts/freelancers/{newFreelancer.Id}", _mapper.Map <DTO.Response.Freelancer>(newFreelancer)));
        }