public EmployeeViewModel GetUserByEmail(string emailAddress) { var user = _employeeRepository.FindBy(x => x.EmailAddress == emailAddress) .SingleOrDefault(); if (user == null) { return(null); } var employeeViewModel = _autoMapper.Map <EmployeeViewModel>(user); return(employeeViewModel); }