I have a service layer which is using unitofwork and Imapper, example given below:
-
- public interface IEmployeeService
- {
- Task AddEmployee(EmployeeListResponseModel model);
- }
- public class EmployeeService : IEmployeeService
- {
- public async Task AddEmployees(EmployeeListResponseModel mode)
- {
- public EmployeeService (IUnitOfWork unitOfWork, IMapper mapper)
- {
- _unitOfWork = unitOfWork;
- _mapper = mapper;
- }
- private readonly IUnitOfWork _unitOfWork;
- private readonly IMapper _mapper;
- }
Question: How can i call this service method "AddEmployees" in one of my class library project? For creating a object of class "EmployeeService" i need to create unitofwork and imapper but i do not know the best practice. Kindly help