コード例 #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!");
        }
コード例 #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();
        }
コード例 #3
0
 public AlbumsController()
 {
     this.db = new ArtistsSystemDbContext();
 }
コード例 #4
0
 public AlbumsController()
 {
     this.db = new ArtistsSystemDbContext();
 }
コード例 #5
0
 public CountriesController()
 {
     this.db = new ArtistsSystemDbContext();
 }
コード例 #6
0
 public CountriesController()
 {
     this.db = new ArtistsSystemDbContext();
 }
コード例 #7
0
 public GenresController()
 {
     this.db = new ArtistsSystemDbContext();
 }
コード例 #8
0
 public SongsController()
 {
     this.db = new ArtistsSystemDbContext();
 }
コード例 #9
0
 public GenresController()
 {
     this.db = new ArtistsSystemDbContext();
 }
コード例 #10
0
 public SongsController()
 {
     this.db = new ArtistsSystemDbContext();
 }