public UserModule(IUserRepository userRepo, ICreateUserCommand createUserCommand, IUpdateUserPasswordCommand updateUserPasswordCommand, IDeleteUserCommand deleteUserCommand) : base() { _userRepo = userRepo; _createUserCommand = createUserCommand; _updateUserPasswordCommand = updateUserPasswordCommand; _deleteUserCommand = deleteUserCommand; Get[Actions.User.Default] = (x) => { AddScript(Scripts.UserView); return(Default()); }; Post[Actions.User.Delete] = (x) => { this.RequiresClaims(new[] { Claims.UserDelete }); return(DeleteUser()); }; Get[Actions.User.List] = (x) => { this.RequiresClaims(new[] { Claims.UserList }); return(List()); }; Post[Actions.User.ChangePassword] = (x) => { return(ChangePassword()); }; Post[Actions.User.Save] = (x) => { this.RequiresClaims(new[] { Claims.UserAdd }); return(Save()); }; }
public UserController(IAddUserCommand addUserCommand, IEditUserCommand editUserCommand, IDeleteUserCommand deleteUserCommand, IGetAllUsersQuery getAllUsersQuery) { _addUserCommand = addUserCommand; _editUserCommand = editUserCommand; _deleteUserCommand = deleteUserCommand; _getAllUsersQuery = getAllUsersQuery; }
public UsersController(IGetUsersCommand getUsers, IGetSingleUserCommand getSingleUser, IInsertUserCommand insertUser, IUpdateUserCommand updateUser, IDeleteUserCommand deleteUser) { _getUsers = getUsers; _getSingleUser = getSingleUser; _insertUser = insertUser; _updateUser = updateUser; _deleteUser = deleteUser; }
public UsersController(ICreateUserCommand createUser, IGetUsersCommand getUsers, IEditUserCommand editUser, IDeleteUserCommand deleteUser, Context baza) { this.createUser = createUser; this.getUsers = getUsers; this.editUser = editUser; this.deleteUser = deleteUser; this.baza = baza; }
public DeleteOrganizationCommand(IDatabaseProvider connection, IDeleteUserCommand deleteUserCommand, IGetUsersByOrganizationQuery getUsersByOrganizationQuery) { _connection = connection; _deleteUserCommand = deleteUserCommand; _getUsersByOrganizationQuery = getUsersByOrganizationQuery; }
public UsersController(IGetUsersCommand getUsers, IGetUserCommand getUser, IAddUserCommand addUser, IEditUserCommand editUser, IDeleteUserCommand deleteUser) { _getUsers = getUsers; _getUser = getUser; _addUser = addUser; _editUser = editUser; _deleteUser = deleteUser; }
public void Setup() { _mockedAddUserCommand = MockRepository.GenerateMock<IAddUserCommand>(); _mockedEditUserCommand = MockRepository.GenerateMock<IEditUserCommand>(); _mockedDeleteUserCommand = MockRepository.GenerateMock<IDeleteUserCommand>(); _mockedGetAllUsersQuery = MockRepository.GenerateMock<IGetAllUsersQuery>(); _controller = new UserController(_mockedAddUserCommand, _mockedEditUserCommand, _mockedDeleteUserCommand, _mockedGetAllUsersQuery); }
public UserController(IGetOneUserCommand getOneUser, ICreateUserCommand createUser, IGetUserCommand getUser, IDeleteUserCommand deleteUser, IUpdateUserCommand updateUser) { _getOneUser = getOneUser; _createUser = createUser; _getUser = getUser; _deleteUser = deleteUser; _updateUser = updateUser; }
public UsersController(IGetUserCommand getOneCommand, IGetUsersCommand getCommand, IAddUserCommand addCommand, IDeleteUserCommand deleteCommand, IUpdateUserCommand updateCommand) { _getOneCommand = getOneCommand; _getCommand = getCommand; _addCommand = addCommand; _deleteCommand = deleteCommand; _updateCommand = updateCommand; }
public UsersController(IDeleteUserCommand deleteUserCommand, IGetUserCommand getUserCommand, IGetUsersCommand getUsersCommand, IInsertUserCommand insertUserCommand, IUpdateUserCommand updateUserCommand) { this.deleteUserCommand = deleteUserCommand; this.getUserCommand = getUserCommand; this.getUsersCommand = getUsersCommand; this.insertUserCommand = insertUserCommand; this.updateUserCommand = updateUserCommand; }
public UserController(IGetUsersCommand getCommand, IGetUserCommand getOneCommand, ICreateUserCommand createUserCommand, IEditUserCommand editUserCommand, IDeleteUserCommand deleteUserCommand) { _getCommand = getCommand; _getOneCommand = getOneCommand; _createUserCommand = createUserCommand; _editUserCommand = editUserCommand; _deleteUserCommand = deleteUserCommand; }
public UsersController(ICreateUserCommand userCreate, IEditUserCommand userEdit, IGetUserCommand userGet, IGetUsersPaginatedCommand usersGet, IDeleteUserCommand deleteUser) { _userCreate = userCreate; _userEdit = userEdit; _userGet = userGet; _usersGet = usersGet; _deleteUser = deleteUser; }
public UserController(IGetUsersCommand getUsersCommand, IAddUserCommand addUserCommand, IGetUserCommand getUserCommand, IDeleteUserCommand deleteUsersCommand, IEditUserCommand editUserCommand) { _getUsersCommand = getUsersCommand; _addUserCommand = addUserCommand; _getUserCommand = getUserCommand; _deleteUsersCommand = deleteUsersCommand; _editUserCommand = editUserCommand; }
public UserController(IAddUserCommand createUser, IGetUsersQuery getUser, IEditUserCommand editUser, IDeleteUserCommand deleteUser, ProjekatContext context) { this.createUser = createUser; this.getUser = getUser; this.editUser = editUser; this.deleteUser = deleteUser; this.context = context; }
public UsersController(IGetUsersCommand getUsers, IGetUserCommand getUser, IAddUserCommand addUser, IEditUserCommand editUser, IDeleteUserCommand deleteUser) { this.getUsers = getUsers; this.getUser = getUser; this.addUser = addUser; this.editUser = editUser; this.deleteUser = deleteUser; }
public UsersController(IGetUserCommand getUser, IGetUsersCommand getUsers, ICreateUserCommand createUser, IEditUserCommand editUser, IDeleteUserCommand deleteUser) { _getUser = getUser; _getUsers = getUsers; _createUser = createUser; _editUser = editUser; _deleteUser = deleteUser; }
public UserController(IGetUserCommand getUserCommand, IGetUsersCommand getUsersCommand, IEditUserCommand editUserCommand, IAddUserCommand addUserCommand, IDeleteUserCommand deleteUserCommand, LoggedUser loggedUser) { _getUsersCommand = getUsersCommand; _getUserCommand = getUserCommand; _editUserCommand = editUserCommand; _addUserCommand = addUserCommand; _deleteUserCommand = deleteUserCommand; _loggedUser = loggedUser; }
public UsersController(IGetUsersCommand searchUsersCommand, IGetUserCommand getOneUserCommand, ICreateUserCommand createUserCommand, IEditUserCommand editUserCommand, IDeleteUserCommand deleteUserCommand, WebNewsContext context) { _searchUsersCommand = searchUsersCommand; _getOneUserCommand = getOneUserCommand; _createUserCommand = createUserCommand; _editUserCommand = editUserCommand; _deleteUserCommand = deleteUserCommand; _context = context; }
public UsersController(Context context, IGetUsersCommand getCommand, IGetUserCommand getOneCommand, IAddUserCommand addUserCommand, IEditUserCommand editUserCommand, IDeleteUserCommand deleteUserCommand) { _context = context; _getCommand = getCommand; _getOneCommand = getOneCommand; _addUserCommand = addUserCommand; _editUserCommand = editUserCommand; _deleteUserCommand = deleteUserCommand; }
public UserController(IGetUsersCommand getUsersCommand, IGetUserCommand getUserCommand, IAddNewUserCommand addUserCommand, IDeleteUserCommand deleteUserCommand, IEmailSender emailSender, IEditUserCommand editUserCommand) { _getUsersCommand = getUsersCommand; _getUserCommand = getUserCommand; _addUserCommand = addUserCommand; _deleteUserCommand = deleteUserCommand; _emailSender = emailSender; _editUserCommand = editUserCommand; }
public UserController(IAddUserCommand addUserCommand, IDeleteUserCommand deleteUserCommand, IGetUserCommand getUserCommand, IEditUserCommand editUserCommand, IGetUsersCommand getUsersCommand, IEmailSender sender) { _addUserCommand = addUserCommand; _deleteUserCommand = deleteUserCommand; _getUserCommand = getUserCommand; _editUserCommand = editUserCommand; _getUsersCommand = getUsersCommand; _sender = sender; }
public UsersController(ICreateUserCommand createUser, IActivateUserCommand activateUser, IGetUsersCommand getUsers, IDeleteUserCommand deleteUser, IEditUserEmailCommand editUserEmail, IEditUserPasswordCommand editUserPassword, IAuthenticateUserCommand authUser) { _createUser = createUser; _activateUser = activateUser; _getUsers = getUsers; _deleteUser = deleteUser; _editUserEmail = editUserEmail; _editUserPassword = editUserPassword; _authUser = authUser; }
public UsersController(IGetUsersCommand getUsers, IGetUserCommand getUser, IAddUserCommand addUser, IGetRolesCommand getRoles, IEditUserCommand editUser, IDeleteUserCommand deleteUser, UseCaseExecutor executor, IAddUserCasesCommand addUserCases) { this.getUsers = getUsers; this.getUser = getUser; this.addUser = addUser; this.getRoles = getRoles; this.editUser = editUser; this.deleteUser = deleteUser; this.executor = executor; this.addUserCases = addUserCases; }
public IActionResult Delete(int id, [FromServices] IDeleteUserCommand command) { try { executor.ExecuteCommand(command, id); return(StatusCode(204, "User deleted")); } catch { return(StatusCode(422, "Fail")); } }
public IActionResult Delete(int id, [FromServices] IDeleteUserCommand command) { try { executor.ExecuteCommand(command, id); return(NoContent()); } catch (EntityNotFoundException ex) { return(NotFound()); } }
public UsersController(IAddUserCommand _addUserCommand, IGetUserCommand _getUserCommand, IGetUsersCommand _getUsersCommand, IEditUserCommand _editUserCommand, IDeleteUserCommand _deleteUserCommand) { this._addUserCommand = _addUserCommand; this._getUserCommand = _getUserCommand; this._getUsersCommand = _getUsersCommand; this._editUserCommand = _editUserCommand; this._deleteUserCommand = _deleteUserCommand; }
public async Task <IActionResult> DeleteUserAsync(Guid userId, [FromServices] IDeleteUserCommand command) { try { await command.ExecuteAsync(userId); return(NoContent()); } catch (Exception exception) { return(BadRequest(exception.Message)); } }
public UsersController(IAddUserCommand addUserCommand, IDeleteUserCommand deleteUserCommand, IUpdateUserCommand updateUserCommand, IGetUserByIdValueQuery getUserByIdValueQuery, IGetAllUsersQuery getAllUsersQuery, IGetAllUsersPaginatedQuery getAllUsersPaginatedQuery) { _addUserCommand = addUserCommand; _deleteUserCommand = deleteUserCommand; _updateUserCommand = updateUserCommand; _getUserByIdValueQuery = getUserByIdValueQuery; _getAllUsersQuery = getAllUsersQuery; _getAllUsersPaginatedQuery = getAllUsersPaginatedQuery; }
public void UserModuleTest_SetUp() { _userRepo = Substitute.For <IUserRepository>(); _userValidator = Substitute.For <IUserValidator>(); _passwordProvider = Substitute.For <IPasswordProvider>(); _createUserCommand = Substitute.For <ICreateUserCommand>(); _updateUserPasswordCommand = Substitute.For <IUpdateUserPasswordCommand>(); _deleteUserCommand = Substitute.For <IDeleteUserCommand>(); Mapper.Initialize((cfg) => { cfg.CreateMap <UserViewModel, UserModel>(); }); }
public UsersController(IGetUserCommand getUser, IGetUsersCommand getUsers, IAddUserCommand addUser, IEditUserCommand editUser, IDeleteUserCommand deleteUser, IGetRolesWithoutPaginationCommand getRoles) { _getUser = getUser; _getUsers = getUsers; _addUser = addUser; _editUser = editUser; _deleteUser = deleteUser; _getRoles = getRoles; }
public UserService(IDeleteUserCommand deleteUserCommand, IUpdateUserCommand updateUserCommand, ICreateUserCommand createUserCommand, IGetUserByIdQuery getUserByIdQuery, IGetAllNonDeletedUsersQuery getAllNonDeletedUsersQuery, IGetUserByUsernameQuery getUserByUsernameQuery, IGetUserByEmailQuery getUserByEmailQuery) { _deleteUserCommand = deleteUserCommand; _updateUserCommand = updateUserCommand; _createUserCommand = createUserCommand; _getUserByIdQuery = getUserByIdQuery; _getAllNonDeletedUsersQuery = getAllNonDeletedUsersQuery; _getUserByUsernameQuery = getUserByUsernameQuery; _getUserByEmailQuery = getUserByEmailQuery; }
public UsersController( ILogger <UsersController> logger, ICreateUserCommand createUserCommand, IUpdateUserCommand updateUserCommand, IDeleteUserCommand deleteUserCommand, IGetUserQuery getUserQuery, IGetAllUsersQuery getAllUsersQuery ) { this.logger = logger; this.createUserCommand = createUserCommand; this.updateUserCommand = updateUserCommand; this.deleteUserCommand = deleteUserCommand; this.getUserQuery = getUserQuery; this.getAllUsersQuery = getAllUsersQuery; }
public UsersController(IAddUserCommand addUserCommand, IEditUserCommand editUserCommand, IDeleteUserCommand deleteUserCommand, IPagingViewModelGenerator pagingViewModelGenerator, IGetUserQuery getUserQuery, ISendNotificationCommand sendNotificationCommand, IEncryptor encryptor, IAuthenticationManager authenticationManager) { _addUserCommand = addUserCommand; _editUserCommand = editUserCommand; _deleteUserCommand = deleteUserCommand; _pagingViewModelGenerator = pagingViewModelGenerator; _getUserQuery = getUserQuery; _sendNotificationCommand = sendNotificationCommand; _encryptor = encryptor; _authenticationManager = authenticationManager; }
public IActionResult Delete(int id, [FromServices] IDeleteUserCommand command) { executor.ExecuteCommand(command, id); return(StatusCode(StatusCodes.Status204NoContent)); }
public void Setup() { _userByEmailQuery = Substitute.For<IUserByEmailQuery>(); _createUserCommand = Substitute.For<ICreateUserCommand>(); _deleteUserCommand = Substitute.For<IDeleteUserCommand>(); }