private User GetCurrentUser() { Volunteer user = _repository.GetAllVolunteers().Where(v => v.UserName.ToLower() == _secWrap.GetCurrentUserName().ToLower()).FirstOrDefault(); if (user != null) { return(user as User); } Admin user2 = _repository.GetAllAdmins().Where(a => a.UserName.ToLower() == _secWrap.GetCurrentUserName().ToLower()).FirstOrDefault(); if (user2 != null) { return(user2 as User); } return(null); }
private Admin GetCurrentUserWithRep() { return(_repository.GetAllAdmins().Where(v => v.UserName.ToLower() == _secWrap.GetCurrentUserName().ToLower()).FirstOrDefault()); }