Ejemplo n.º 1
0
 public async void SaveAsync(History entity)
 {
     using (var data = new PomodoroContext())
     {
         data.Stories.Add(entity);
         await data.SaveChangesAsync();
     }
 }
 private async void DeleteAsync()
 {
     using (var data = new PomodoroContext())
     {
         var configs = data.Configurations.ToList();
         data.Configurations.RemoveRange(configs);
         await data.SaveChangesAsync();
     }
 }
 public async void SaveAsync(Configuration config)
 {
     DeleteAsync();
     using (var data = new PomodoroContext())
     {
         data.Configurations.Add(config);
         await data.SaveChangesAsync();
     }
 }
Ejemplo n.º 4
0
 public async void DeleteStores()
 {
     using (var data = new PomodoroContext())
     {
         var entities = data.Stories.ToList();
         data.Stories.RemoveRange(entities);
         await data.SaveChangesAsync();
     }
 }