46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using ATM_Banking_System.Services;
|
|
namespace ATM_Banking_System
|
|
{
|
|
public class Startup
|
|
{
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddControllersWithViews();
|
|
|
|
|
|
services.AddScoped<CustomerService>();
|
|
}
|
|
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
{
|
|
if (env.IsDevelopment())
|
|
{
|
|
app.UseDeveloperExceptionPage();
|
|
}
|
|
else
|
|
{
|
|
app.UseExceptionHandler("/Home/Error");
|
|
app.UseHsts();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseStaticFiles();
|
|
|
|
app.UseRouting();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.UseEndpoints(endpoints =>
|
|
{
|
|
endpoints.MapControllerRoute(
|
|
name: "default",
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
|
endpoints.MapControllerRoute(
|
|
name: "customer",
|
|
pattern: "customer/{action=\"CreateCustomer\"}/{id?}",
|
|
defaults: new { controller = "Customer" });
|
|
});
|
|
}
|
|
}
|
|
}
|