Beispiel #1
0
        public AllAppointmentsResponse getAll()
        {
            try
            {
                var response = new AllAppointmentsResponse();
                var bc       = new AppointmentComponent();
                response.Result = bc.ToList();

                return(response);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };
                throw new HttpResponseException(httpError);
            }
        }
Beispiel #2
0
        public ActionResult GetData()
        {
            List <Appointment> data = db.ToList();

            return(Json(new { data = data }, JsonRequestBehavior.AllowGet));
        }