public QueryResult <MasterDataSummaryBO> Get([FromQuery] QueryParameter requestParameter) { var personId = p_AppSession.PersonID; var query = TasqR.Run(new GetMasterDataQr(p_AppSession.PlanYear, personId)); return(query); }
public IProcessTrackerBase Calculate(CalculateParameter parameter) { parameter["PersonId"] = p_AppSession.PersonID?.ToString(); var cmd = new MasterProcessCmd(MainConstants.Job.MainCalc, parameter); return(TasqR.Run(cmd)); }
public QueryResult <PayRunBO> Get([FromQuery] QueryParameter requestParameter) { short planYear = requestParameter.GetFromFilter <short>("PlanYear"); var query = TasqR.Run(new GetPayRunQr(planYear)); return(query); }
public void CanRunWithKeyBaseType() { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CommandWithKeyHandler>(); var tasqR = new TasqR(handlerResolver); var instance = Activator.CreateInstance(typeof(CommandWithKey)); tasqR.Run((ITasq <int, bool>)instance); Assert.IsTrue(((CommandWithKey)instance).AllAreCorrect); }
public void CanRunWithKey() { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CommandWithKeyHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new CommandWithKey(); tasqR.Run(cmd); Assert.IsTrue(cmd.AllAreCorrect); }
public void CanRunWithReturnForAsyncHandler() { int startNumber = 8; var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <TestCmdWithReturnForAsyncHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new TestCmdWithReturnForAsync(startNumber); int finalNumber = tasqR.Run(cmd); Assert.AreEqual(9, finalNumber); }
public void CanRunWithReturn() { int startNumber = 8; var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <SampleCommandWithReturnHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new SampleCommandWithReturn(startNumber); int finalNumber = tasqR.Run(cmd); Assert.AreEqual(9, finalNumber); }
public void CanRunWithKeyForAsyncHandlerBaseType() { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CommandWithKeyAsyncHandler>(); var tasqR = new TasqR(handlerResolver); var instance = (ITasq)Activator.CreateInstance(typeof(CommandWithKeyAsync)); tasqR.Run(instance); Assert.IsTrue(true); }
public bool Save([FromBody] string token) { try { TasqR.Run(new SaveFirebaseTokenCmd(token)); return(true); } catch (Exception ex) { p_Logger.LogError(ex); return(false); } }
public void CanRunWithoutReturnForAsyncHandler() { var testModel = new Test3Model { StartNumber = 10 }; var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CommandWithAsyncWithoutReturnHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new CommandWithAsyncWithoutReturn(testModel); tasqR.Run(cmd); Assert.AreEqual(11, testModel.StartNumber); }
public void CanRunWithoutReturn() { var testModel = new TestModel { SampleNumber = 10 }; var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <SampleCommandWithoutReturnHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new SampleCommandWithoutReturn(testModel); tasqR.Run(cmd); Assert.AreEqual(11, testModel.SampleNumber); }
public void CanThrowExceptionIfNoHandlerRegistered() { try { var handlerResolver = new TasqHandlerResolver(); var tasqR = new TasqR(handlerResolver); var cmd = new CommandWithKey(); tasqR.Run(cmd); } catch (Exception ex) { Assert.AreEqual("Type CommandWithKey not registered", ex.Message); throw; } }
public void CannotRunDefaultCmdWithHandlerWithNoParamlessConstructor() { try { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CmdHandlerWithNoParamlessCtorHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new CmdHandlerWithNoParamlessCtor(); tasqR.Run(cmd); } catch (Exception ex) { Assert.IsTrue(ex.Message.StartsWith("No parameterless constructor defined for type")); throw; } }
public void CanRunWithKeyForAsyncHandler() { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CommandWithKeyAsyncHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new CommandWithKeyAsync(); bool allAreTrue = true; foreach (var item in tasqR.Run(cmd)) { if (!item) { allAreTrue = false; } } Assert.IsTrue(allAreTrue); }
public IProcessTrackerBase ImportPerson(ImportPersonParameter parameter) { var cmd = new MasterProcessCmd(MainConstants.Job.ImportPerson, parameter); return(TasqR.Run(cmd)); }
public QueryResult <PlanYearBO> Get([FromQuery] QueryParameter requestParameter) { return(TasqR.Run(new GetPlanYearQr(requestParameter))); }