-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
Just completed (nearly all) your Lynda course (which is excellent by the way) following along using Core 2. I thought you might be interested in a couple of things that break:
In Startup.cs:
// Add ASP.NET Core Identity
services.AddIdentity<UserEntity, UserRoleEntity>()
.AddEntityFrameworkStores<HotelApiContext, Guid>()
.AddDefaultTokenProviders();
needs to go to:
// Add ASP.NET Core Identity
services.AddIdentity<UserEntity, UserRoleEntity>()
.AddEntityFrameworkStores<HotelApiContext>()
.AddDefaultTokenProviders();
and in the UsersController.cs:
var canSeeEveryone = await _authzService
.AuthorizeAsync(User, "ViewAllUsersPolicy");
if (canSeeEveryone)
{
users = await _userService.GetUsersAsync(
pagingOptions, sortOptions, searchOptions, ct);
}
Error CS0029 Cannot implicitly convert type 'Microsoft.AspNetCore.Authorization.AuthorizationResult' to 'bool' bodimecore ...\Controllers\UsersController.cs error
Which I've not had time to look at yet. (Monday hopefully).
Thanks again for the great course.
caiobep
Metadata
Metadata
Assignees
Labels
No labels