1

I cloned an ASP.NET Core 2 project with git and it uses Entity Framework Core with MySQL database.

services.AddDbContext<ApplicationDbContext>(options =>
            options.UseMySql(Configuration.GetConnectionString("Default")));

Is it possible for me to contribute on this project but use my local SQL Server instead of MySQL and don't change this on source?

I tried changing UseMySql to UseSqlServer with the right connection string but it threw exception in migrations.

1
  • It is possible but half your battle would be spent ensuring you keep your Sql Server references out of the repo. Easily done in git by not tracking certain files but the hard one will be Startup.cs. You would also have to generate migrations for Sql Server and keep them in a separate assembly, likely with it's own DbContext. How much do you want to contribute to this project when you add this overhead for yourself? Commented Jan 23, 2018 at 23:58

1 Answer 1

1

Not easily. If the application wasn't designed with this scenario in mind, you may have to update a lot of it to work on Microsoft SQL Server.

If you're just trying to avoid installing MySQL locally, I've found using Docker ideal for that. (See the mysql/mysql-server image.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.