Exemple #1
0
        public async Task <ActionResult <List <EmploymentDto> > > GetAllEmployments([FromQuery] int?subscriptionId)
        {
            var employments = subscriptionId == null
                ? await _employmentService.GetEmploymentsAsync()
                : await _employmentService.GetEmploymentsBySubscriptionIdAsync(subscriptionId.Value);

            var response = _mapper.Map <List <EmploymentDto> >(employments);

            return(Ok(response));
        }