Пример #1
0
 public Task InsertTask(Task task)
 {
     using (var db = new IMS189Entities())
     {
         db.Tasks.Add(task);
         db.SaveChanges();
     }
     return(task);
 }
Пример #2
0
        public IList <Task> GetTasks()
        {
            List <Task> tasks = new List <Task>();

            using (var db = new IMS189Entities())
            {
                var query = from b in db.Tasks select b;
                foreach (Task task in query)
                {
                    tasks.Add(task);
                }
            }
            return(tasks);
        }