示例#1
0
        public void CheckAwaitingReminders(object dummy)
        {
            var ids = _storage
                      .Get(ReminderItemStatus.Awaiting)
                      .Where(r => r.IsTimeToSend)
                      .Select(r => r.Id);

            _storage.UpdateStatus(ids, ReminderItemStatus.Ready);
        }
        public IActionResult UpdateReminderStatus([FromBody] ReminderItemsUpdateModel reminderItemsUpdateModel)
        {
            if (reminderItemsUpdateModel == null || !ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var reminderItemModelToPatch = new ReminderItemUpdateModel();

            reminderItemsUpdateModel.PatchDocument.ApplyTo(reminderItemModelToPatch);

            _reminderStorage.UpdateStatus(reminderItemsUpdateModel.Ids, reminderItemModelToPatch.Status);

            return(NoContent());
        }
示例#3
0
        private void CheckAwaitingReminders(object dummy)
        {
            var ids = _storage
                      .Get(ReminderItemStatus.Awaiting)
                      .Where(r => r.IsTimeToSend)
                      .Select(r => r.Id)
                      .ToList();

            if (ids.Count > 0)
            {
                _storage.UpdateStatus(
                    ids,
                    ReminderItemStatus.Ready);
            }
        }
示例#4
0
        public IActionResult UpdateReminderStatus(Guid id,
                                                  [FromBody] JsonPatchDocument <ReminderItemsUpdateModel> patchDocument)
        {
            var reminderItem = _reminderStorage.Get(id);

            if (reminderItem == null)
            {
                return(BadRequest());
            }

            if (reminderItem == null || !ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var reminderItemModelToPatch = new ReminderItemUpdateModel
            {
                Status = reminderItem.Status
            };

            patchDocument.ApplyTo(reminderItemModelToPatch);

            _reminderStorage.UpdateStatus(
                id,
                reminderItemModelToPatch.PatchDocument);
        }
示例#5
0
        public void CheckAwaitingReminders()
        {
            var ids = storage.Get(ReminderStatus.Awaiting, 0, 0).Where(r => r.IsTimeToAlarm).Select(r => r.Id);

            storage.UpdateStatus(ids, ReminderStatus.ReadyToSend);
        }