public static void MoveTask(dynamic metadata, dynamic content) { var id = content.Id.ToString(); var toid = content.ToParentId.ToString(); var groupKey = metadata.GroupKey.ToString(); var memberKey = metadata.MemberKey.ToString(); var task = Todos.SingleOrDefault(t => t.Id == id); var newParent = Todos.SingleOrDefault(t => t.Id == toid); if (task != null && newParent != null) { task.GroupKey = newParent.GroupKey; task.MemberKey = newParent.MemberKey; task.ParentId = toid; var dataToSend = new { GroupKey = groupKey, MemberKey = memberKey, Id = id, NewParentId = toid }; SendFeedbackMessage(type: MsgType.Success, actionTime: GetCreateDate(metadata), action: MapAction.Task.MoveTask.Name, content: dataToSend); } }
static TodoItem FindById(string groupKey, dynamic id) => Todos.SingleOrDefault(t => t.GroupKey == groupKey && t.Id == id);