public async Task CanRunWithKey() { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CommandWithKeyAsyncHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new CommandWithKeyAsync(); int initialCount = cmd.Keys.Count; bool allAreTrue = true; int callCount = 0; var result = await tasqR.RunAsync(cmd); foreach (var item in result) { callCount++; if (!item) { allAreTrue = false; } } Assert.AreEqual(initialCount, callCount); Assert.IsTrue(allAreTrue); }
protected async override Task OnInitializedAsync() { var planYearResponse = await TasqR.RunAsync(new GetPlanYearQr()); PlanYearData = planYearResponse.Data; CanCalculate = await DataService.GetAsync <bool>(AerishAdminConstants.Uri.MasterData + "/CanCalculate"); }
public async Task <QueryResult <EmployeeSummaryBO> > Search([FromQuery] QueryParameter requestParameter, CancellationToken cancellationToken = default) { var result = await TasqR.RunAsync(new GetEmployeesQr(requestParameter.Filter.Value, DataResultType.Summary), cancellationToken); return(new QueryResult <EmployeeSummaryBO> { Count = result.Count, Data = result.Data }); }
public async Task <NodeItemSetBO> Get ( int?employeeId = null, string filter = null, string currentUri = null ) { var navigations = await TasqR.RunAsync(new GetNavigationQr(employeeId, filter, currentUri)); return(navigations); }
public async Task CanRunWithReturn() { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <TestCmdWithReturnForAsyncHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new TestCmdWithReturnForAsync(2); var result = await tasqR.RunAsync(cmd); Assert.AreEqual(3, result); }
public Task <TokenVerificationResult> VerifyValidity([FromBody] string firebaseToken) { return(Task.FromResult(new TokenVerificationResult { TokenStatus = TokenStatus.Active })); string authorization = Request.Headers["Authorization"]; string token = authorization?.Split(' ').LastOrDefault(); var tokenMgr = (JwtSignInManager)p_SignInManager; var sessionID = tokenMgr.ExtractSessionIDFromToken(token); return(TasqR.RunAsync(new VerifyTokenValidityCmd(sessionID.GetValueOrDefault()))); }
public async Task CanRunWithoutReturn() { var testModel = new Test3Model { StartNumber = 10 }; var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CommandWithAsyncWithoutReturnHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new CommandWithAsyncWithoutReturn(testModel); await tasqR.RunAsync(cmd); Assert.AreEqual(11, testModel.StartNumber); }
public async Task WillThrowExceptionFromAsyncHandler() { try { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <TestWithErrorCmdHandler>(); var tasqR = new TasqR(handlerResolver); var cmd = new TestWithErrorCmd(); await tasqR.RunAsync(cmd); } catch (AggregateException ex) { throw ex.GetBaseException(); } }
public async Task CanRunWithKeyBaseType() { var handlerResolver = new TasqHandlerResolver(); handlerResolver.Register <CommandWithKeyAsyncHandler>(); var tasqR = new TasqR(handlerResolver); var instance = (ITasq <int, bool>)Activator.CreateInstance(typeof(CommandWithKeyAsync)); bool allAreTrue = true; foreach (var item in await tasqR.RunAsync(instance)) { if (!item) { allAreTrue = false; } } Assert.IsTrue(allAreTrue); }
public async Task LoadNavigations(int?employeeId = null, string search = null) { string navUri = navigationManager.ToBaseRelativePath(navigationManager.Uri); var result = await TasqR.RunAsync(new GetNavigationQr(employeeId, search, navUri)); FlatData.Clear(); foreach (var item in result.Nodes) { FlatData.Add(item); } if (result.SelectedNode != null) { SelectedNavigations = new List <object>() { result.SelectedNode }; } }
protected async Task OnWindowCalculatePayRun() { WindowVisible = false; CanCalculate = false; var calcParam = new CalculateParameter { PayRunID = NewCalcPayRun.PayRunID.GetValueOrDefault(), PlanYear = NewCalcPayRun.PlanYear.GetValueOrDefault(), PersonID = await AppSession.GetEmployeeID() }; var cmd = new MasterProcessCmd(MainConstants.Job.MainCalc, calcParam); var result = await TasqR.RunAsync(cmd); //var calcParam = new CalculateParameterVM //{ // PayRunID = NewCalcPayRun.PayRunID, // PlanYear = NewCalcPayRun.PlanYear, // PersonID = await AppSession.GetEmployeeID() //}; //var result = await DataService.PostAsync<ProcessTrackerVM, CalculateParameterVM> // ( // AerishAdminConstants.Uri.CalculateMasterData, // calcParam // ); CanCalculate = true; NewCalcPayRun = new PayRunVM(); PayRunData = null; lastPlanYear = null; await OnReload(); }
public async Task <IEnumerable <BillSummaryBO> > Get(CancellationToken cancellationToken = default) { return(await TasqR.RunAsync(new GetBillsQr(), cancellationToken)); }
public Task <TextTemplateVM> Get(string code, CancellationToken cancellationToken = default) { return(TasqR.RunAsync(new FindTextTemplateQr(code), cancellationToken)); }
public Task <CreateResult <TrackBillBO> > Create(TrackBillBO newEntry, CancellationToken cancellationToken = default) { return(TasqR.RunAsync(new CreateTrackBillCmd(newEntry, true), cancellationToken)); }
public Task <BillPaymentStepsTemplateVM> FindBillTemplate(int billTemplateID, CancellationToken cancellationToken = default) { return(TasqR.RunAsync(new FindBillPaymentStepsTemplateQr(billTemplateID), cancellationToken)); }
public Task <TrackBillBO> Get(Guid id) { return(TasqR.RunAsync(new FindTrackBillQr(id))); }
public Task <IEnumerable <BillPaymentStepsTemplateSummaryVM> > Search(short billID, string query, CancellationToken cancellationToken = default) { return(TasqR.RunAsync(new GetBillPaymentStepsTemplatesQr(billID, query), cancellationToken)); }
public Task Delete(Guid id, CancellationToken cancellationToken = default) { return(TasqR.RunAsync(new DeleteTrackBillCmd(id), cancellationToken)); }
public Task <long> ParsePost(CancellationToken cancellationToken = default) { var parameters = new List <MailPart>(); p_Logger.LogInformation("Header Count: {0}", Request.Headers.Count); foreach (var header in Request.Headers) { parameters.Add(new MailPart { PartType = MailPartType.Header, Key = header.Key, Value = new Dictionary <string, object> { { "Value", header.Value } } }); } p_Logger.LogInformation("Form Count: {0}", Request.Form.Count); foreach (var formItem in Request.Form) { parameters.Add(new MailPart { PartType = MailPartType.Form, Key = formItem.Key, Value = new Dictionary <string, object> { { "Value", formItem.Value } } }); } p_Logger.LogInformation("Files Count: {0}", Request.Form.Files.Count); foreach (IFormFile file in Request.Form.Files) { if (file.Length == 0) { continue; } using (var ms = new MemoryStream()) { file.CopyTo(ms); var fileBytes = ms.ToArray(); parameters.Add(new MailPart { PartType = MailPartType.Attachment, Key = file.FileName, Value = new Dictionary <string, object> { { "Content-Type", file.ContentType }, { "Length", file.Length }, { "ContentDisposition", file.ContentDisposition }, { "Content", fileBytes } } }); } } p_Logger.LogInformation("Mail Parse - POST"); return(TasqR.RunAsync(new SaveMailCmd(parameters), cancellationToken)); }
public Task <UserBillBO> Get(Guid id) { return(TasqR.RunAsync(new FindUserBillQr(id))); }
public Task <IEnumerable <UserBillSummaryBO> > Get(int forecastDays = 30) { return(TasqR.RunAsync(new GetUserBillsQr(AppUser.UserID, forecastDays))); }
public Task <UserBO> Get() { return(TasqR.RunAsync(new GetUserDetailQr(AppUser.UserID))); }
public Task <MarkPaidResult> MarkBillAsPaid(Guid id) { return(TasqR.RunAsync(new MarkUserBillAsPaidCmd(id))); }
public Task <IEnumerable <TrackBillSummaryBO> > Get() { return(TasqR.RunAsync(new GetTrackBillsQr(AppUser.UserID))); }