I have a service layer which is using unitofwork and Imapper, example given below:
- //Service layer
- 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
Rupesh KahanePosted Apr 17, 2019, 7:28 AM
Please refer below article
https://www.c-sharpcorner.com/article/crud-operation-using-repository-unit-of-work-pattern/