help
using Microsoft.EntityFrameworkCore;
using Office.DataAccess;
using Office.DataAccess.Repository;
using Office.DataAccess.Repository.IRepository;
using Microsoft.AspNetCore.Identity;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(
builder.Configuration.GetConnectionString("DefaultConnection")
));
//options => options.SignIn.RequireConfirmedAccount = true
builder.Services.AddDefaultIdentity<IdentityUser>()
.AddEntityFrameworkStores<ApplicationDbContext>();
builder.Services.AddScoped<IUnitOfWork,UnitOfWork>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();;
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
UnitOfWork
because it does not know how to make an Office.DataAccess.ApplicationDbContext
ApplicationDbContext
added to the services in Program.cs is 100% Office.DataAccess.ApplicationDbContext
?/bin
and /obj
and run again? 😬IUnitOfWork
?IUnitOfWork
Sign In and Join Server To See
Sign In and Join Server To See
Sign In and Join Server To See
Sign In and Join Server To See
Sign In and Join Server To See
Sign In and Join Server To See
Sign In and Join Server To See