コード例 #1
0
        public async Task DeleteTest()
        {
            var fakeRepository      = Mock.Of <IPrescriptionRepository>();
            var prescriptionService = new PrescriptionService(fakeRepository);

            var prescription = new Prescription()
            {
                PatientName = "Dias", Instruction = "Not for a child", Frequency = "2 times a day"
            };
            await prescriptionService.Delete(prescription);
        }
コード例 #2
0
        public ActionResult Delete(long id)
        {
            var service = new PrescriptionService();

            var prescription = service.GetID(id);

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

            service.Delete(prescription);

            return(Ok());
        }