Advertisement
XfreeBG

Untitled

Apr 29th, 2023
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. using Bank_Web_App.Services;
  2. using BankApplication_Web.Data;
  3. using Microsoft.EntityFrameworkCore;
  4.  
  5. var builder = WebApplication.CreateBuilder(args);
  6.  
  7. // Add services to the container.
  8. builder.Services.AddControllersWithViews();
  9. builder.Services.AddDbContext<BankContext>(c => c.UseMySQL("Server=\"bankweb.mysql.database.azure.com\";UserID = \"XFreeBG\";Password=\"Bank1234\";Database=\"bankweb\";")); //Change the data here
  10.  
  11. builder.Services.AddScoped<BankService, BankService>();
  12. builder.Services.AddScoped<UserService, UserService>();
  13.  
  14. var app = builder.Build();
  15.  
  16. // Configure the HTTP request pipeline.
  17. if (!app.Environment.IsDevelopment())
  18. {
  19. app.UseExceptionHandler("/Home/Error");
  20. // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
  21. app.UseHsts();
  22. }
  23.  
  24. app.UseHttpsRedirection();
  25. app.UseStaticFiles();
  26.  
  27. app.UseRouting();
  28.  
  29. app.UseAuthorization();
  30.  
  31. app.MapControllerRoute(
  32. name: "default",
  33. pattern: "{controller=Home}/{action=Index}/{id?}");
  34.  
  35. app.Run();
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement