public int DeleteReminder(ReminderDataStructure reminderDataStructureInstance) { var id = reminderDataStructureInstance.Id; if (id != 0) { lock (collisionLock) { database.Delete <ReminderDataStructure>(id); } } this.Reminders.Remove(reminderDataStructureInstance); return(id); }
public int SaveReminder(ReminderDataStructure reminderDataStructureInstance) { lock (collisionLock) { if (reminderDataStructureInstance.Id != 0) { database.Update(reminderDataStructureInstance); Reminders.Add(reminderDataStructureInstance); return(reminderDataStructureInstance.Id); } else { database.Insert(reminderDataStructureInstance); Reminders.Add(reminderDataStructureInstance); return(reminderDataStructureInstance.Id); } } }