public GetUsersDTO GetUserInformation(int GetUserId) { var user = _AngularAppCompanyEntities.User_Information.Where(a => a.Id == GetUserId).Where(a => a.Active == true).SingleOrDefault(); GetUsersDTO getUsersDTO = new GetUsersDTO(); getUsersDTO.Id = user.Id; getUsersDTO.AccountName = user.AccountName; getUsersDTO.DisplayName = user.DisplayName; getUsersDTO.Email = user.Email; getUsersDTO.Designation = user.Designation; getUsersDTO.Department = user.Department; getUsersDTO.Created = user.Created.ToString(); return(getUsersDTO); }
public ICollection <GetUsersDTO> GetUserInformations() { var users = _AngularAppCompanyEntities.User_Information.OrderBy(a => a.Id).Where(a => a.Active == true).ToList(); List <GetUsersDTO> usersDTOList = new List <GetUsersDTO>(); foreach (var item in users) { GetUsersDTO getUsersDTO = new GetUsersDTO(); getUsersDTO.Id = item.Id; getUsersDTO.AccountName = item.AccountName; getUsersDTO.DisplayName = item.DisplayName; getUsersDTO.Email = item.Email; getUsersDTO.Designation = item.Designation; getUsersDTO.Department = item.Department; getUsersDTO.Created = item.Created.ToString(); usersDTOList.Add(getUsersDTO); } return(usersDTOList); }