diff --git a/RentACar/Data/Data/RentACarDbContext.cs b/RentACar/Data/Data/RentACarDbContext.cs index 5e28229..80fe50b 100644 --- a/RentACar/Data/Data/RentACarDbContext.cs +++ b/RentACar/Data/Data/RentACarDbContext.cs @@ -20,7 +20,7 @@ namespace Data { if (!optionsBuilder.IsConfigured) { - optionsBuilder.UseSqlServer("Server=.\\SQLEXPRESS;Database=RentACar;Integrated Security=true;"); + optionsBuilder.UseSqlServer("Server=.;Database=RentACar;Integrated Security=true;"); } } diff --git a/RentACar/Data/Migrations/20220406212949_migrena1.Designer.cs b/RentACar/Data/Migrations/20220407201957_migrena.Designer.cs similarity index 91% rename from RentACar/Data/Migrations/20220406212949_migrena1.Designer.cs rename to RentACar/Data/Migrations/20220407201957_migrena.Designer.cs index a4c2b04..1f08e92 100644 --- a/RentACar/Data/Migrations/20220406212949_migrena1.Designer.cs +++ b/RentACar/Data/Migrations/20220407201957_migrena.Designer.cs @@ -10,8 +10,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Data.Migrations { [DbContext(typeof(RentACarDbContext))] - [Migration("20220406212949_migrena1")] - partial class migrena1 + [Migration("20220407201957_migrena")] + partial class migrena { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -124,7 +124,7 @@ namespace Data.Migrations .HasColumnType("nvarchar(max)"); b.Property("PersonalNumber") - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(450)"); b.Property("PhoneNumber") .HasColumnType("nvarchar(max)"); @@ -152,20 +152,24 @@ namespace Data.Migrations .HasDatabaseName("UserNameIndex") .HasFilter("[NormalizedUserName] IS NOT NULL"); + b.HasIndex("PersonalNumber") + .IsUnique() + .HasFilter("[PersonalNumber] IS NOT NULL"); + b.ToTable("AspNetUsers"); b.HasData( new { - Id = "8fb80b37-172b-4100-b499-cfa8b8bd225f", + Id = "387f2544-bfa8-44ed-9793-a5bd5eaafe57", AccessFailedCount = 0, - ConcurrencyStamp = "863ef77f-ca57-4cdc-8a69-2034d137775e", + ConcurrencyStamp = "6fa96ce1-7e47-4f44-bdeb-e13705729bdb", Email = "admin@admin.admin", EmailConfirmed = false, LockoutEnabled = false, - PasswordHash = "AQAAAAEAACcQAAAAEA2HtcFcKoyTZ8qyX/ACxeWR3uxNREHn09A1/5s+c2wzkUUOThsWUqEiv7Rn3vmgJQ==", + PasswordHash = "AQAAAAEAACcQAAAAECdhgDXw9WdaYvos/Ef9zaSiSApNswFCna2iNk8tu8BsvXRVMQWvdPLE1L8sTdgjDQ==", PhoneNumberConfirmed = false, - SecurityStamp = "670d518e-9966-41bb-ae76-3a8968513497", + SecurityStamp = "db1ac172-eb3b-4b93-9f31-3f748a1eda84", TwoFactorEnabled = false, UserName = "admin" }); @@ -200,14 +204,14 @@ namespace Data.Migrations b.HasData( new { - Id = "6d92895f-aab5-46b6-8650-0d8c1b566372", - ConcurrencyStamp = "372dca25-7ccc-4995-9b3f-32bfdebc1ff6", + Id = "fb054f77-3578-45ee-a3d6-e6fe706526b2", + ConcurrencyStamp = "4af0d06c-63be-448c-a1ee-7c369398dee5", Name = "Admin" }, new { - Id = "b57865e0-539e-4f79-8215-103e22016c83", - ConcurrencyStamp = "97e7c5da-d35b-475b-85cd-f5df914e5850", + Id = "d3aa27bb-2866-4a7d-9f0d-30498859ae94", + ConcurrencyStamp = "64b281d1-f963-43ae-a25e-1f8f220b553d", Name = "Employee" }); }); @@ -299,13 +303,13 @@ namespace Data.Migrations b.HasData( new { - UserId = "8fb80b37-172b-4100-b499-cfa8b8bd225f", - RoleId = "6d92895f-aab5-46b6-8650-0d8c1b566372" + UserId = "387f2544-bfa8-44ed-9793-a5bd5eaafe57", + RoleId = "fb054f77-3578-45ee-a3d6-e6fe706526b2" }, new { - UserId = "8fb80b37-172b-4100-b499-cfa8b8bd225f", - RoleId = "b57865e0-539e-4f79-8215-103e22016c83" + UserId = "387f2544-bfa8-44ed-9793-a5bd5eaafe57", + RoleId = "d3aa27bb-2866-4a7d-9f0d-30498859ae94" }); }); diff --git a/RentACar/Data/Migrations/20220406212949_migrena1.cs b/RentACar/Data/Migrations/20220407201957_migrena.cs similarity index 92% rename from RentACar/Data/Migrations/20220406212949_migrena1.cs rename to RentACar/Data/Migrations/20220407201957_migrena.cs index e55c18f..59e1597 100644 --- a/RentACar/Data/Migrations/20220406212949_migrena1.cs +++ b/RentACar/Data/Migrations/20220407201957_migrena.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace Data.Migrations { - public partial class migrena1 : Migration + public partial class migrena : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -28,7 +28,7 @@ namespace Data.Migrations Id = table.Column(type: "nvarchar(450)", nullable: false), FirstName = table.Column(type: "nvarchar(max)", nullable: true), LastName = table.Column(type: "nvarchar(max)", nullable: true), - PersonalNumber = table.Column(type: "nvarchar(max)", nullable: true), + PersonalNumber = table.Column(type: "nvarchar(450)", nullable: true), UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), @@ -204,27 +204,27 @@ namespace Data.Migrations migrationBuilder.InsertData( table: "AspNetRoles", columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" }, - values: new object[] { "6d92895f-aab5-46b6-8650-0d8c1b566372", "372dca25-7ccc-4995-9b3f-32bfdebc1ff6", "Admin", null }); + values: new object[] { "fb054f77-3578-45ee-a3d6-e6fe706526b2", "4af0d06c-63be-448c-a1ee-7c369398dee5", "Admin", null }); migrationBuilder.InsertData( table: "AspNetRoles", columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" }, - values: new object[] { "b57865e0-539e-4f79-8215-103e22016c83", "97e7c5da-d35b-475b-85cd-f5df914e5850", "Employee", null }); + values: new object[] { "d3aa27bb-2866-4a7d-9f0d-30498859ae94", "64b281d1-f963-43ae-a25e-1f8f220b553d", "Employee", null }); migrationBuilder.InsertData( table: "AspNetUsers", columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "FirstName", "LastName", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PersonalNumber", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" }, - values: new object[] { "8fb80b37-172b-4100-b499-cfa8b8bd225f", 0, "863ef77f-ca57-4cdc-8a69-2034d137775e", "admin@admin.admin", false, null, null, false, null, null, null, "AQAAAAEAACcQAAAAEA2HtcFcKoyTZ8qyX/ACxeWR3uxNREHn09A1/5s+c2wzkUUOThsWUqEiv7Rn3vmgJQ==", null, null, false, "670d518e-9966-41bb-ae76-3a8968513497", false, "admin" }); + values: new object[] { "387f2544-bfa8-44ed-9793-a5bd5eaafe57", 0, "6fa96ce1-7e47-4f44-bdeb-e13705729bdb", "admin@admin.admin", false, null, null, false, null, null, null, "AQAAAAEAACcQAAAAECdhgDXw9WdaYvos/Ef9zaSiSApNswFCna2iNk8tu8BsvXRVMQWvdPLE1L8sTdgjDQ==", null, null, false, "db1ac172-eb3b-4b93-9f31-3f748a1eda84", false, "admin" }); migrationBuilder.InsertData( table: "AspNetUserRoles", columns: new[] { "RoleId", "UserId" }, - values: new object[] { "6d92895f-aab5-46b6-8650-0d8c1b566372", "8fb80b37-172b-4100-b499-cfa8b8bd225f" }); + values: new object[] { "fb054f77-3578-45ee-a3d6-e6fe706526b2", "387f2544-bfa8-44ed-9793-a5bd5eaafe57" }); migrationBuilder.InsertData( table: "AspNetUserRoles", columns: new[] { "RoleId", "UserId" }, - values: new object[] { "b57865e0-539e-4f79-8215-103e22016c83", "8fb80b37-172b-4100-b499-cfa8b8bd225f" }); + values: new object[] { "d3aa27bb-2866-4a7d-9f0d-30498859ae94", "387f2544-bfa8-44ed-9793-a5bd5eaafe57" }); migrationBuilder.CreateIndex( name: "IX_AspNetRoleClaims_RoleId", @@ -258,6 +258,13 @@ namespace Data.Migrations table: "AspNetUsers", column: "NormalizedEmail"); + migrationBuilder.CreateIndex( + name: "IX_AspNetUsers_PersonalNumber", + table: "AspNetUsers", + column: "PersonalNumber", + unique: true, + filter: "[PersonalNumber] IS NOT NULL"); + migrationBuilder.CreateIndex( name: "UserNameIndex", table: "AspNetUsers", diff --git a/RentACar/Data/Migrations/RentACarDbContextModelSnapshot.cs b/RentACar/Data/Migrations/RentACarDbContextModelSnapshot.cs index 9353409..3390eac 100644 --- a/RentACar/Data/Migrations/RentACarDbContextModelSnapshot.cs +++ b/RentACar/Data/Migrations/RentACarDbContextModelSnapshot.cs @@ -122,7 +122,7 @@ namespace Data.Migrations .HasColumnType("nvarchar(max)"); b.Property("PersonalNumber") - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(450)"); b.Property("PhoneNumber") .HasColumnType("nvarchar(max)"); @@ -150,20 +150,24 @@ namespace Data.Migrations .HasDatabaseName("UserNameIndex") .HasFilter("[NormalizedUserName] IS NOT NULL"); + b.HasIndex("PersonalNumber") + .IsUnique() + .HasFilter("[PersonalNumber] IS NOT NULL"); + b.ToTable("AspNetUsers"); b.HasData( new { - Id = "8fb80b37-172b-4100-b499-cfa8b8bd225f", + Id = "387f2544-bfa8-44ed-9793-a5bd5eaafe57", AccessFailedCount = 0, - ConcurrencyStamp = "863ef77f-ca57-4cdc-8a69-2034d137775e", + ConcurrencyStamp = "6fa96ce1-7e47-4f44-bdeb-e13705729bdb", Email = "admin@admin.admin", EmailConfirmed = false, LockoutEnabled = false, - PasswordHash = "AQAAAAEAACcQAAAAEA2HtcFcKoyTZ8qyX/ACxeWR3uxNREHn09A1/5s+c2wzkUUOThsWUqEiv7Rn3vmgJQ==", + PasswordHash = "AQAAAAEAACcQAAAAECdhgDXw9WdaYvos/Ef9zaSiSApNswFCna2iNk8tu8BsvXRVMQWvdPLE1L8sTdgjDQ==", PhoneNumberConfirmed = false, - SecurityStamp = "670d518e-9966-41bb-ae76-3a8968513497", + SecurityStamp = "db1ac172-eb3b-4b93-9f31-3f748a1eda84", TwoFactorEnabled = false, UserName = "admin" }); @@ -198,14 +202,14 @@ namespace Data.Migrations b.HasData( new { - Id = "6d92895f-aab5-46b6-8650-0d8c1b566372", - ConcurrencyStamp = "372dca25-7ccc-4995-9b3f-32bfdebc1ff6", + Id = "fb054f77-3578-45ee-a3d6-e6fe706526b2", + ConcurrencyStamp = "4af0d06c-63be-448c-a1ee-7c369398dee5", Name = "Admin" }, new { - Id = "b57865e0-539e-4f79-8215-103e22016c83", - ConcurrencyStamp = "97e7c5da-d35b-475b-85cd-f5df914e5850", + Id = "d3aa27bb-2866-4a7d-9f0d-30498859ae94", + ConcurrencyStamp = "64b281d1-f963-43ae-a25e-1f8f220b553d", Name = "Employee" }); }); @@ -297,13 +301,13 @@ namespace Data.Migrations b.HasData( new { - UserId = "8fb80b37-172b-4100-b499-cfa8b8bd225f", - RoleId = "6d92895f-aab5-46b6-8650-0d8c1b566372" + UserId = "387f2544-bfa8-44ed-9793-a5bd5eaafe57", + RoleId = "fb054f77-3578-45ee-a3d6-e6fe706526b2" }, new { - UserId = "8fb80b37-172b-4100-b499-cfa8b8bd225f", - RoleId = "b57865e0-539e-4f79-8215-103e22016c83" + UserId = "387f2544-bfa8-44ed-9793-a5bd5eaafe57", + RoleId = "d3aa27bb-2866-4a7d-9f0d-30498859ae94" }); }); diff --git a/RentACar/WebApp/Areas/Identity/Pages/Account/Register.cshtml.cs b/RentACar/WebApp/Areas/Identity/Pages/Account/Register.cshtml.cs index f6f01b4..61078be 100644 --- a/RentACar/WebApp/Areas/Identity/Pages/Account/Register.cshtml.cs +++ b/RentACar/WebApp/Areas/Identity/Pages/Account/Register.cshtml.cs @@ -14,7 +14,6 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; -using Microsoft.EntityFrameworkCore; namespace WebApp.Areas.Identity.Pages.Account { @@ -23,16 +22,19 @@ namespace WebApp.Areas.Identity.Pages.Account { private readonly SignInManager _signInManager; private readonly UserManager _userManager; + private readonly RoleManager _roleManager; private readonly ILogger _logger; private readonly IEmailSender _emailSender; public RegisterModel( UserManager userManager, SignInManager signInManager, + RoleManager roleManager, ILogger logger, IEmailSender emailSender) { _userManager = userManager; + _roleManager = roleManager; _signInManager = signInManager; _logger = logger; _emailSender = emailSender; @@ -57,13 +59,12 @@ namespace WebApp.Areas.Identity.Pages.Account [Display(Name = "Email")] public string Email { get; set; } - [Display(Name = "First name")] + [Display(Name = "First Name")] public string FirstName { get; set; } - [Display(Name = "Last name")] + [Display(Name = "Last Name")] public string LastName { get; set; } - [Phone] [Display(Name = "Phone")] public string PhoneNumber { get; set; } @@ -98,6 +99,9 @@ namespace WebApp.Areas.Identity.Pages.Account var result = await _userManager.CreateAsync(user, Input.Password); if (result.Succeeded) { + var defaultrole = _roleManager.FindByIdAsync("d3aa27bb-2866-4a7d-9f0d-30498859ae94").Result; + + await _userManager.AddToRoleAsync(user, defaultrole.Name); _logger.LogInformation("User created a new account with password."); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); diff --git a/RentACar/WebApp/Controllers/CarsController.cs b/RentACar/WebApp/Controllers/CarsController.cs index a4cd610..2f3885e 100644 --- a/RentACar/WebApp/Controllers/CarsController.cs +++ b/RentACar/WebApp/Controllers/CarsController.cs @@ -70,6 +70,7 @@ namespace WebApp.Controllers // GET: Cars/Edit/5 [HttpGet] + [Authorize(Roles = "Admin")] public async Task Edit(int? id) { if (id == null) @@ -90,6 +91,7 @@ namespace WebApp.Controllers // For more details, see http://go.microsoft.com/fwlink/?LinkId=317598. [HttpPost] [ValidateAntiForgeryToken] + [Authorize(Roles = "Admin")] public async Task Edit(int id, [Bind("Id, Brand, Model, Year, CountPassengerSeats, Description, PriceForDay")] Car car) { if (id != car.Id) @@ -122,6 +124,7 @@ namespace WebApp.Controllers // GET: Cars/Delete/5 [HttpGet] + [Authorize(Roles = "Admin")] public async Task Delete(int? id) { if (id == null) diff --git a/RentACar/WebApp/Controllers/UsersController.cs b/RentACar/WebApp/Controllers/UsersController.cs index f652472..c021dcf 100644 --- a/RentACar/WebApp/Controllers/UsersController.cs +++ b/RentACar/WebApp/Controllers/UsersController.cs @@ -7,9 +7,21 @@ using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.EntityFrameworkCore; using Data; using Data.Entities; +using Microsoft.AspNetCore.Authorization; namespace WebApp.Controllers { + public class UserWithRoles + { + public string UserName { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + public string Email { get; set; } + public string PersonalNumber { get; set; } + public string PhoneNumber { get; set; } + public string Role { get; set; } + } + public class UsersController : Controller { private readonly RentACarDbContext _context; @@ -20,52 +32,36 @@ namespace WebApp.Controllers } // GET: Users + [Authorize(Roles = "Admin")] public async Task Index() { - return View(await _context.Users.ToListAsync()); - } + ICollection users = await _context.Users.ToListAsync(); - // GET: Users/Details/5 - public async Task Details(string id) - { - if (id == null) - { - return NotFound(); - } + ICollection usersWithRole = new List(); - var user = await _context.Users - .FirstOrDefaultAsync(m => m.Id == id); - if (user == null) - { - return NotFound(); - } + //foreach (var item in users) + //{ + // var userRole = await _context.UserRoles.FirstOrDefaultAsync(userRoles => userRoles.UserId == item.Id); + // var role = await _context.Roles.FirstOrDefaultAsync(role => role.Id == userRole.RoleId); + // usersWithRole.Add( + // new UserWithRoles() + // { + // UserName = item.UserName, + // FirstName = item.FirstName, + // LastName = item.LastName, + // Email = item.Email, + // PersonalNumber = item.PersonalNumber, + // PhoneNumber = item.PhoneNumber, + // Role = role.Name + // } + // ); + //} - return View(user); - } - - // GET: Users/Create - public IActionResult Create() - { - return View(); - } - - // POST: Users/Create - // To protect from overposting attacks, enable the specific properties you want to bind to. - // For more details, see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] - public async Task Create([Bind("FirstName,LastName,PersonalNumber,Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] User user) - { - if (ModelState.IsValid) - { - _context.Add(user); - await _context.SaveChangesAsync(); - return RedirectToAction(nameof(Index)); - } - return View(user); + return View(users); } // GET: Users/Edit/5 + [Authorize(Roles = "Admin")] public async Task Edit(string id) { if (id == null) @@ -86,6 +82,7 @@ namespace WebApp.Controllers // For more details, see http://go.microsoft.com/fwlink/?LinkId=317598. [HttpPost] [ValidateAntiForgeryToken] + [Authorize(Roles = "Admin")] public async Task Edit(string id, [Bind("FirstName,LastName,PersonalNumber,Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] User user) { if (id != user.Id) @@ -117,6 +114,7 @@ namespace WebApp.Controllers } // GET: Users/Delete/5 + [Authorize(Roles = "Admin")] public async Task Delete(string id) { if (id == null) @@ -137,6 +135,7 @@ namespace WebApp.Controllers // POST: Users/Delete/5 [HttpPost, ActionName("Delete")] [ValidateAntiForgeryToken] + [Authorize(Roles = "Admin")] public async Task DeleteConfirmed(string id) { var user = await _context.Users.FindAsync(id); diff --git a/RentACar/WebApp/Views/Shared/_Layout.cshtml b/RentACar/WebApp/Views/Shared/_Layout.cshtml index d89e475..f8cb8f2 100644 --- a/RentACar/WebApp/Views/Shared/_Layout.cshtml +++ b/RentACar/WebApp/Views/Shared/_Layout.cshtml @@ -24,9 +24,15 @@ + + @if (this.User.IsInRole("Admin")) + { + } diff --git a/RentACar/WebApp/Views/Users/Create.cshtml b/RentACar/WebApp/Views/Users/Create.cshtml deleted file mode 100644 index 5c34fe4..0000000 --- a/RentACar/WebApp/Views/Users/Create.cshtml +++ /dev/null @@ -1,118 +0,0 @@ -@model Data.Entities.User - -@{ - ViewData["Title"] = "Create"; -} - -

Create

- -

User

-
-
-
-
-
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- -
-
- -
-
- - - -
-
- -
-
- - - -
-
- -
-
-
-
- - - -@section Scripts { - @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} -} diff --git a/RentACar/WebApp/Views/Users/Index.cshtml b/RentACar/WebApp/Views/Users/Index.cshtml index 72e545d..ac3e36e 100644 --- a/RentACar/WebApp/Views/Users/Index.cshtml +++ b/RentACar/WebApp/Views/Users/Index.cshtml @@ -6,9 +6,6 @@

Index

-

- Create New -

@@ -24,45 +21,12 @@ - - - - - - - - - - - @@ -81,45 +45,12 @@ - - - - - - - - - - -
@Html.DisplayNameFor(model => model.UserName) - @Html.DisplayNameFor(model => model.NormalizedUserName) - @Html.DisplayNameFor(model => model.Email) - @Html.DisplayNameFor(model => model.NormalizedEmail) - - @Html.DisplayNameFor(model => model.EmailConfirmed) - - @Html.DisplayNameFor(model => model.PasswordHash) - - @Html.DisplayNameFor(model => model.SecurityStamp) - - @Html.DisplayNameFor(model => model.ConcurrencyStamp) - @Html.DisplayNameFor(model => model.PhoneNumber) - @Html.DisplayNameFor(model => model.PhoneNumberConfirmed) - - @Html.DisplayNameFor(model => model.TwoFactorEnabled) - - @Html.DisplayNameFor(model => model.LockoutEnd) - - @Html.DisplayNameFor(model => model.LockoutEnabled) - - @Html.DisplayNameFor(model => model.AccessFailedCount) -
@Html.DisplayFor(modelItem => item.UserName) - @Html.DisplayFor(modelItem => item.NormalizedUserName) - @Html.DisplayFor(modelItem => item.Email) - @Html.DisplayFor(modelItem => item.NormalizedEmail) - - @Html.DisplayFor(modelItem => item.EmailConfirmed) - - @Html.DisplayFor(modelItem => item.PasswordHash) - - @Html.DisplayFor(modelItem => item.SecurityStamp) - - @Html.DisplayFor(modelItem => item.ConcurrencyStamp) - @Html.DisplayFor(modelItem => item.PhoneNumber) - @Html.DisplayFor(modelItem => item.PhoneNumberConfirmed) - - @Html.DisplayFor(modelItem => item.TwoFactorEnabled) - - @Html.DisplayFor(modelItem => item.LockoutEnd) - - @Html.DisplayFor(modelItem => item.LockoutEnabled) - - @Html.DisplayFor(modelItem => item.AccessFailedCount) - Edit | Details | diff --git a/RentACar/WebApp/WebApp.csproj b/RentACar/WebApp/WebApp.csproj index 880cf2b..6c65f91 100644 --- a/RentACar/WebApp/WebApp.csproj +++ b/RentACar/WebApp/WebApp.csproj @@ -1,4 +1,4 @@ - + net5.0 diff --git a/RentACar/WebApp/appsettings.json b/RentACar/WebApp/appsettings.json index e899df0..5bd170a 100644 --- a/RentACar/WebApp/appsettings.json +++ b/RentACar/WebApp/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=.\\SQLEXPRESS;Database=RentACar;Integrated Security=true;" + "DefaultConnection": "Server=.;Database=RentACar;Integrated Security=true;" }, "Logging": { "LogLevel": { diff --git a/RentACar/WebApp/bin/Debug/net5.0/appsettings.json b/RentACar/WebApp/bin/Debug/net5.0/appsettings.json index e899df0..5bd170a 100644 --- a/RentACar/WebApp/bin/Debug/net5.0/appsettings.json +++ b/RentACar/WebApp/bin/Debug/net5.0/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=.\\SQLEXPRESS;Database=RentACar;Integrated Security=true;" + "DefaultConnection": "Server=.;Database=RentACar;Integrated Security=true;" }, "Logging": { "LogLevel": {