// 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);
        }
Beispiel #2
0
        public dynamic GetstaffByAccessToken(long id)
        {
            StaffDto dto = staffRepository.getStaff(id);

            if (dto == null)
            {
                return(NotFound());
            }
            return(Ok(dto));
        }