Uri ReminderUrl(NewReminder reminder)
 {
     var url = Url.Resource<GetReminderController>(new
     {
         reminder.VehicleId,
         reminder.ReminderId
     });
     return new Uri(url, UriKind.Relative);
 }
        Uri ReminderUrl(NewReminder reminder)
        {
            var url = Url.Resource <GetReminderController>(new
            {
                reminder.VehicleId,
                reminder.ReminderId
            });

            return(new Uri(url, UriKind.Relative));
        }
 HttpResponseMessage ReminderCreated(NewReminder reminder)
 {
     return(new HttpResponseMessage(HttpStatusCode.Created)
     {
         Headers =
         {
             Location = ReminderUrl(reminder)
         }
     });
 }
 HttpResponseMessage ReminderCreated(NewReminder reminder)
 {
     return new HttpResponseMessage(HttpStatusCode.Created)
     {
         Headers =
         {
             Location = ReminderUrl(reminder)
         }
     };
 }
        public HttpResponseMessage PostReminder(int vehicleId, NewReminder reminder)
        {
            reminder.VehicleId = vehicleId;

            var errors = canAddReminder.Execute(1, reminder);
            ModelState.AddModelErrors(errors);

            if (ModelState.IsValid)
            {
                addReminderToVehicle.Execute(1, vehicleId, reminder);
                return ReminderCreated(reminder);
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest, ModelState);
            }
        }
        public HttpResponseMessage PostReminder(int vehicleId, NewReminder reminder)
        {
            reminder.VehicleId = vehicleId;

            var errors = canAddReminder.Execute(1, reminder);

            ModelState.AddModelErrors(errors);

            if (ModelState.IsValid)
            {
                addReminderToVehicle.Execute(1, vehicleId, reminder);
                return(ReminderCreated(reminder));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState));
            }
        }