Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The project should be database independent #33

Open
kedare opened this issue Jan 28, 2017 · 2 comments
Open

The project should be database independent #33

kedare opened this issue Jan 28, 2017 · 2 comments

Comments

@kedare
Copy link

kedare commented Jan 28, 2017

Hello.

I wanted to test this generator for .NET core but apparently it's quite hard to use is without SQL Server, event after changing the connection string and adapting the Startup.cs, there are references of SQL Server specifics features in the migrations.

I think it could be interesting to make the boilerplate independent from any database.

Thanks

@earthslasthope
Copy link

Try the following:

yo react-aspnet-boilerplate:empty-template

That one does not use a database (or at least doesn't appear to).

@mudrz
Copy link
Contributor

mudrz commented Feb 21, 2017

To use a different Entity Framework provider do the following:
project.json

//"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
    "Npgsql.EntityFrameworkCore.PostgreSQL": "1.1.0",

Startup.cs

// Add framework services.
// services.AddDbContext<ApplicationDbContext>(options =>
//      options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

services.AddDbContext<ApplicationDbContext>(options =>
        options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection")));

Migrations folder
delete all files, then run in terminal/command prompt
dotnet ef migrations add initial
dotnet ef database update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants