コード例 #1
0
        public virtual TaskList CreateList(string name, bool publicList)
        {
            var context = new TaskDataContext();
            var list = new TaskList { Name = name, IsPublic = publicList };
            context.AddObject(TaskDataContext.TaskListTable, list.ToRow());
            context.SaveChanges();

            return list;
        }
コード例 #2
0
        public virtual void UpdateList(TaskList list)
        {
            var context = new TaskDataContext();
            var taskListRow = list.ToRow();

            context.AttachTo(TaskDataContext.TaskListTable, taskListRow, "*");
            context.UpdateObject(taskListRow);
            context.SaveChanges();
        }