Exemplo n.º 1
0
        public static void Main()
        {
            Database.SetInitializer(new DropCreateDatabaseAlways <ArtistsSystemDbContext>());

            var db = new ArtistsSystemDbContext();

            DataImporter artistsSystemDataImporter = new ArtistsSystemDataImporter();

            artistsSystemDataImporter.AddDataImporter(new CountriesImporter());
            artistsSystemDataImporter.AddDataImporter(new ProducersImporter());
            artistsSystemDataImporter.AddDataImporter(new AlbumsImporter());
            artistsSystemDataImporter.AddDataImporter(new ArtistsImporter());
            artistsSystemDataImporter.AddDataImporter(new SongsImporter());

            Console.WriteLine("Seedeing initial data to database!");
            artistsSystemDataImporter.ImportData(db);
            Console.WriteLine("Done!");
        }
Exemplo n.º 2
0
        public static void Main()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <ArtistsSystemDbContext, Configuration>());
            ArtistsSystemDbContext.Create().Database.Initialize(true);

            Console.WriteLine("Loading server...");
            Thread.Sleep(2000);

            var countriesConnection = "http://localhost:59705/api/countries";

            GetJsonCountries(new Uri(countriesConnection));
            Thread.Sleep(2000);

            PostCountry(countriesConnection, "Bulgaria");
            PostCountry(countriesConnection, "Russia");
            PutCountry(countriesConnection + "/9", "Indonesia");
            DeleteCoutry(countriesConnection);
            Console.ReadLine();
        }
 public AlbumsController()
 {
     this.db = new ArtistsSystemDbContext();
 }
Exemplo n.º 4
0
 public AlbumsController()
 {
     this.db = new ArtistsSystemDbContext();
 }
 public CountriesController()
 {
     this.db = new ArtistsSystemDbContext();
 }
 public CountriesController()
 {
     this.db = new ArtistsSystemDbContext();
 }
Exemplo n.º 7
0
 public GenresController()
 {
     this.db = new ArtistsSystemDbContext();
 }
 public SongsController()
 {
     this.db = new ArtistsSystemDbContext();
 }
 public GenresController()
 {
     this.db = new ArtistsSystemDbContext();
 }
 public SongsController()
 {
     this.db = new ArtistsSystemDbContext();
 }