public IEnumerable <WorkShiftView> Get() { var models = repo.getAllWorkShifts(); var views = WorkShiftView.getViews(models); return(views); }
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)); } }