Skip to content
ozinus edited this page Aug 26, 2019 · 9 revisions

dotnet-ef migrations add firstmigration

"ConnectionStrings": { "CityContext": "server = 127.0.0.1; uid = root; pwd = 12345678; database = CityInfoDB" }

using System; using System.IO; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; using ProjectX2.Entities;

namespace ProjectX2 {

public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<LibraryContext>
{
    public LibraryContext CreateDbContext(string[] args)
    {
        IConfigurationRoot configuration = new ConfigurationBuilder()
            .SetBasePath(Directory.GetCurrentDirectory())
            .AddJsonFile("appsettings.json")
            .Build();
        var builder = new DbContextOptionsBuilder<LibraryContext>();
        var connectionString = configuration.GetConnectionString("LibraryContext");
        builder.UseMySQL(connectionString);
        return new LibraryContext(builder.Options);
    }
} 

}

https://www.entityframeworktutorial.net/efcore/entity-framework-core-migration.aspx

Following are the dependencies: Those should be installed.

  •  "prop-types": "^15.7.2",
    
  • "react": "^16.9.0", 
    
  • "react-dom": "^16.9.0", 
    
  • "react-scripts": "3.1.1"
    

-type npm start to start the site..

Clone this wiki locally