public IActionResult Update(Guid id, [FromBody] UpdateReminderItemViewModel model)
        {
            var existsItem = _storage.FindById(id);
            var item       = new ReminderItem(
                id,
                existsItem.ContactId,
                model.Message,
                DateTimeOffset.FromUnixTimeMilliseconds(model.DateTimeUtc),
                model.Status);

            _storage.Update(item);
            return(Ok());
        }
        public IActionResult GetById(Guid id)
        {
            if (id == default)
            {
                return(BadRequest());
            }

            var item = _storage.FindById(id);

            if (item == default)
            {
                return(NotFound());
            }

            var model = new ReminderItemViewModel(item);

            return(Ok(model));
        }
Пример #3
0
        public IActionResult Get(Guid id)
        {
            if (id == Guid.Empty)
            {
                return(BadRequest());
            }
            var item = _storage.FindById(id);

            return(Ok(item));
        }