Esempio n. 1
0
        public void Put(int id, WorkShiftView view)
        {
            view.id = id;
            var model = view.getModel();

            model.updated = DateTime.UtcNow;
            repo.update(model);
        }
        public HttpResponseMessage Post(WorkShiftView view)
        {
            var model = view.getModel();
            model.created = DateTime.UtcNow;
            model.updated = DateTime.UtcNow;
            model = repo.createWorkShift(model);
            view = new WorkShiftView(model);

            var response = Request.CreateResponse<WorkShiftView>(HttpStatusCode.Created, view);
            string uri = Url.Route(null, new { id = view.id });
            response.Headers.Location = new Uri(Request.RequestUri, uri);
            return response;
        }
Esempio n. 3
0
        public HttpResponseMessage Post(WorkShiftView view)
        {
            var model = view.getModel();

            model.created = DateTime.UtcNow;
            model.updated = DateTime.UtcNow;
            model         = repo.createWorkShift(model);
            view          = new WorkShiftView(model);

            var    response = Request.CreateResponse <WorkShiftView>(HttpStatusCode.Created, view);
            string uri      = Url.Route(null, new { id = view.id });

            response.Headers.Location = new Uri(Request.RequestUri, uri);
            return(response);
        }
 public void Put(int id, WorkShiftView view)
 {
     view.id = id;
     var model = view.getModel();
     model.updated = DateTime.UtcNow;
     repo.update(model);
 }