Esempio n. 1
0
        public async Task <IActionResult> PutShelterEmployee(int id, ShelterEmployee shelterEmployee)
        {
            if (id != shelterEmployee.Id)
            {
                return(BadRequest());
            }

            _context.Entry(shelterEmployee).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ShelterEmployeeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <ActionResult <ShelterEmployee> > PostShelterEmployee(ShelterEmployee shelterEmployee)
        {
            _context.ShelterEmployees.Add(shelterEmployee);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetShelterEmployee", new { id = shelterEmployee.Id }, shelterEmployee));
        }
Esempio n. 3
0
 public void EmployeeAdd(Employee man)
 {
     ShelterEmployee.Add(man);
 }