Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StartViewModel"/> class.
        /// </summary>
        public StartViewModel()
        {
            CreateDbCommand = new RelayCommand(() =>
            {
                /* Following are few steps which will make easy to work with Sqlite...
                 * 1. Install Sqlite provider for design time in visual studio
                 * http://system.data.sqlite.org/downloads/1.0.99.0/sqlite-netFx46-setup-bundle-x86-2015-1.0.99.0.exe
                 * 2. Install-Package System.Data.SQLite (This will install core,linq,EF6)...
                 * 3. Install-Package SQLiteNetExtensions if required for mapping
                 * 4. Install-Package SQLite.CodeFirst for code first approch if required
                 */

                MessageBox.Show("Hello !");

                using (var footballDbCdontext = new PatientDbContext())
                {
                    foreach (var team in footballDbCdontext.Set <User>())
                    {
                        var aa = team;
                    }
                }

                //var footballDbContext = new FootballDbContext();
                //foreach (var team in footballDbContext.Set<Team>())
                //{
                //    var aa = team;
                //}

                //var myDbContext = new MyDbContext();
                //foreach (var team in myDbContext.Set<AspNetUser>())
                //{
                //    var aa = team;
                //}

                MessageBox.Show("DB creation done !");


                //var dbFirstContext = new SqliteDbFirstConn();
                //var teamPlayers = dbFirstContext.TeamPlayers.ToList();
            });
        }