protected CommandResult ExecuteCommand <TCommand>(ICommandRepository <TCommand> repository, TCommand command) where TCommand : Command { try { repository.Execute(command); } catch (Exception ex) { Logger.Error(ex, $"Unhandled exception: {ex.Message}"); return(new CommandResult(command, false).Fatal($"Unhandled exception: {ex.Message}", ex)); } return(new CommandResult(command)); }
public void ResetPassword(Guid userSysId, string newPasswordHash) { _commandRepository.Execute($"update {EntityMapper<SysUser>.GetTableName()} set passwordhash = @newPasswordHash where sysid = @userSysId", new { userSysId, newPasswordHash }); }