public UserMembershipService(EmployeeAssembler employeeAssembler, 
                                     SupplierEmployeeAssembler supplierEmployeeAssembler, 
                                     UserAssembler userAssembler)
        {
            _employeeAssembler = employeeAssembler;
            _supplierEmployeeAssembler = supplierEmployeeAssembler;
            _userAssembler = userAssembler;

            UserDictionary = new Dictionary<string, UserDto>();
            EmployeeDictionary = new Dictionary<string, EmployeeDto>();
            SupplierEmployeeDictionary = new Dictionary<string, SupplierEmployeeDto>();
            UserLoginDictionary = new Dictionary<string, string>();

            var employees = db.Employees.Include(x => x.User).Where(x => x.DeletedOn.HasValue == false);
            foreach (var employee in employees)
            {
                EmployeeDictionary.Add(employee.Email, _employeeAssembler.Assemble(employee));
            }

            var supplierEmployees = db.SupplierEmployees.Include(x => x.User).Include(x => x.Supplier).Where(x => x.DeletedOn.HasValue == false);
            foreach (var supplierEmployee in supplierEmployees)
            {
                SupplierEmployeeDictionary.Add(supplierEmployee.Email, _supplierEmployeeAssembler.Assemble(supplierEmployee));
            }

            var users = db.Users.Include(x => x.UserType).Include(x => x.Gender).Where(x => x.DeletedOn.HasValue == false);
            foreach (var user in users)
            {
                UserDictionary.Add(user.Email, _userAssembler.Assemble(user));
                UserLoginDictionary.Add(user.Email, user.PasswordHash);
            }
        }
 public EmployeeDto Assemble(Employee entity)
 {
     if (entity == null) { return null; }
     var userAssembler = new UserAssembler();
     return new EmployeeDto
     {
         Id = entity.Id,
         Comment = entity.Comment,
         LastUpdatedBy = entity.LastUpdatedBy,
         CreatedOn = entity.CreatedOn,
         UpdatedOn = entity.UpdatedOn,
         DeletedOn = entity.DeletedOn.HasValue ? entity.DeletedOn.Value : new DateTime(),
         User = userAssembler.Assemble(entity.User),
         Email = entity.Email,
         UserName = entity.UserName,
         PasswordHash = entity.PasswordHash,
         Department = entity.Department,
         PrimaryPhone = entity.PrimaryPhone
     };
 }