// GET: api/Staffs public List <StaffDto> Getstaffs() { List <staff> staffs = db.staffs.ToList(); List <StaffDto> results = new List <StaffDto>(); foreach (staff staff in staffs) { StaffDto dto = staffRepository.getStaff(staff.auth_token); results.Add(dto); } return(results); }
public dynamic GetstaffByAccessToken(long id) { StaffDto dto = staffRepository.getStaff(id); if (dto == null) { return(NotFound()); } return(Ok(dto)); }