Actually i have been developing a project on a hotel booking system which is actually a web app, but i am encountering an error related to AppDbContext when i run the code on visual code 2022, which is as follows, my login page appears but when i login, it doesn’t redirect me to the homepage rather this error is displaying.
I tried to edit my code for AppDbContext many times and also includes a parametrized constructor but it didn’t work out! And this is what my connection string looks like , kindly also please tell me is my connection string also looking alright ?
builder.Services.AddDbContext<AppDbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("{"default": "Data Source=localhost\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;Trust Server Certificate=True;" }")));
And this is actually i have included my connection string in my program.cs.
Amna A is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.