public void UpdateStatus(Guid id, ReminderItemStatus status)
 {
     using (var context = new ReminderStorageContext(_builder.Options))
     {
         ReminderItemDto dto = context.ReminderItems.Find(id);
         dto.Status = status;
         context.SaveChanges();
     }
 }
        public Guid Add(ReminderItemRestricted reminder)
        {
            var dto = new ReminderItemDto();

            using (var context = new ReminderStorageContext(_builder.Options))
            {
                context.ReminderItems.Add(dto);
                context.SaveChanges();
                return(dto.Id);
            }
        }
Пример #3
0
        public Guid Add(ReminderItemRestricted reminder)
        {
            var reminderDto = new ReminderItemDto
            {
                ContactId  = reminder.ContactId,
                TargetDate = reminder.Date,
                Message    = reminder.Message,
                Status     = reminder.Status
            };

            using (var context = new ReminderStorageContext(_builder.Options))
            {
                context.ReminderItems.Add(reminderDto);
                context.SaveChanges();
                return(reminderDto.Id);
            }
        }