コード例 #1
0
ファイル: App.xaml.cs プロジェクト: kneefer/FitAndGym
 private async Task Init()
 {
     using (var db = new FitAndGymDataContext(DBConnectionString))
     {
         db.Log = new Utilities.DebugTextWriter();
         if (db.DatabaseExists() == false)
         {
             db.CreateDatabase();
             db.SubmitChanges();
         }
     }
     await App.FitAndGymViewModel.LoadTrainingDaysCollectionFromDatabase();
     await App.FitAndGymViewModel.LoadExercisesCollectionFromDatabase();
 }
コード例 #2
0
 public FitAndGymViewModel() { } // to fulfill Design-Time data access requirements
 public FitAndGymViewModel(string fitAndGymConnectionString)
 {
     db = new FitAndGymDataContext(fitAndGymConnectionString);
     db.Log = new Utilities.DebugTextWriter();
 }