public async Task <ServiceResponse <Icc> > CreateIccEmp(Icc icc) { ServiceResponse <Icc> serviceResponse = new ServiceResponse <Icc>(); try { // Complaint complaint1 = new Complaint(); //we can use AutoMapper here // Complaint sc = _mapper.Map<Complaint>(complaint1); serviceResponse.Data = await _empRepository.AddData(icc); serviceResponse.Message = "Icc Employee Created"; } catch (Exception ex) { serviceResponse.IsSuccess = false; serviceResponse.Message = ex.Message; _logger.LogError($"Something went wrong inside CreateSchedule action: {ex.Message}"); } return(serviceResponse); }