public void Add(DataModel.Task task)
 {
     using (var db = new SQLiteConnection(FileName))
     {
         db.Insert(task);
     }
 }
 public DataModel.Task Get(Guid id)
 {
     using (var db = new SQLiteConnection(FileName))
     {
         DataModel.Task task = (from t in db.Table <DataModel.Task>() where t.ID == id select t).FirstOrDefault();
         return(task);
     }
 }
Beispiel #3
0
 public void Add(DataModel.Task task)
 {
     using (var ctx = new TaskContext(ConnectionString))
     {
         TaskContext.Tasks.AddOrUpdate(task);
         TaskContext.SaveChanges();
     }
 }
 public void Update(DataModel.Task task)
 {
     using (var db = new SQLiteConnection(FileName))
     {
         //var y = db.Table<DataModel.Task>().Where(x => x.ID == task.ID).FirstOrDefault();
         //Mapper.Map(task,y);
         db.Update(task);
     }
 }
Beispiel #5
0
 public void Update(DataModel.Task task)
 {
     DataModel.Task Update = GetAll().FirstOrDefault(e => e.ID == task.ID);
     Update = task;
     TaskManagementEntities.SaveChanges();
 }
Beispiel #6
0
 public void Add(DataModel.Task task)
 {
     TaskManagementEntities.Tasks.AddOrUpdate(task);
     TaskManagementEntities.SaveChanges();
 }
Beispiel #7
0
 public void Update(DataModel.Task task)
 {
     Add(task);
 }
 public void Update(DataModel.Task task)
 {
     DataModel.Task updateTask = Tasks.FirstOrDefault(t => t.ID == task.ID);
     Mapper.Map(task, updateTask);
     WriteData(Tasks, JsonData);
 }
 public void Add(DataModel.Task task)
 {
     Tasks.Add(task);
     WriteData(Tasks, JsonData);
 }