예제 #1
0
        public IEnumerable <EmployeeView> Get()
        {
            var models = repo.getAllEmployees();
            var views  = EmployeeView.getViews(models);

            return(views);
        }
        public HttpResponseMessage Employees(int id)
        {
            var model = repo.getCategory(id);

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