AspNetCoreGraphQL-MyHotel
AspNetCoreGraphQL-MyHotel copied to clipboard
Move database configuration to config file instead of hardcoding
Use:
services.AddDbContext<MyHotelDbContext>(options => options.UseSqlServer(Configuration["ConnectionStrings:MyHotelDb"]));
And define appsettings .Development.json like:
"ConnectionStrings": {
"MyHotelDb": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=MyHoteDbl;Trusted_Connection=True;MultipleActiveResultSets=true"
},