Example #1
0
        public IEnumerable <WorkShiftView> Get()
        {
            var models = repo.getAllWorkShifts();
            var views  = WorkShiftView.getViews(models);

            return(views);
        }
Example #2
0
        public HttpResponseMessage WorkShifts(int id)
        {
            var model = repo.getEmployee(id);

            if (model == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            else
            {
                var workShifts = model.workShifts;
                var views      = WorkShiftView.getViews(workShifts);
                return(Request.CreateResponse(HttpStatusCode.OK, views));
            }
        }