//private StudentService _studentService = new StudentService(); public IEnumerable <UserProfile> GetAllUsers() { try { IEnumerable <UserProfile> users = _userRepository.GetAllUsers(); return(users); } catch (SqlException e) { Console.WriteLine("Service error " + e); } return(null); }
/// <summary> /// To get all the users /// </summary> /// <returns></returns> public List <UserModel> GetAllUsers() { return(repoUser.GetAllUsers().Select(x => new UserModel { Employee_ID = x.Employee_ID, First_Name = x.First_Name, Last_Name = x.Last_Name, Project_ID = x.Project_ID, User_ID = x.User_ID }).ToList()); }
public void ResetPasswordSendMail(string username) { string password = _userRepository.ResetPassword(username); string getUserEmail = _userRepository.GetAllUsers().Where(x => x.Username == username).Select(x => x.Email).FirstOrDefault(); if (getUserEmail != null) { MailHelper.SendMail(new List <string> { getUserEmail }, "*****@*****.**", "New Password", password); } }