public UserController(IClientAuthorizationData clientAuthorizationData, IUsersService usersService, IMapper mapper) { _clientAuthorizationData = clientAuthorizationData; _usersService = usersService; _mapper = mapper; }
public async Task InvokeAsync(HttpContext context, IClientAuthorizationData clientAuthorizationData) { var claimsIdentity = context.User.Identity as ClaimsIdentity; var userId = claimsIdentity?.FindFirst(ClaimTypes.Name); clientAuthorizationData.UserId = userId?.Value; await _next.Invoke(context); }
public ProjectsService(IMongoDatabase database, IClientAuthorizationData clientAuthorizationData) { _clientAuthorizationData = clientAuthorizationData; _projectsDatabase = database.GetCollection <Project>("projects"); }
public UsersService(IMongoDatabase database, IClientAuthorizationData clientAuthorizationData) { _clientAuthorizationData = clientAuthorizationData; _usersDatabase = database.GetCollection <User>("users"); }