コード例 #1
0
        public ActionResult <Vet> Get(long id)
        {
            var service = new VetService();

            var vet = service.GetID(id);

            if (vet == null)
            {
                return(NotFound());
            }

            return(vet);
        }
コード例 #2
0
        public ActionResult Delete(long id)
        {
            var service = new VetService();

            var vet = service.GetID(id);

            if (vet == null)
            {
                return(NotFound());
            }

            service.Delete(vet);

            return(Ok());
        }
コード例 #3
0
        public ActionResult <Vet> Put(long id, [FromBody] Vet vet)
        {
            var service = new VetService();

            if (service.GetID(id) == null)
            {
                return(NotFound());
            }

            vet.VetID = id;

            service.Store(vet);

            return(vet);
        }