public Task <ActionResult <Voucher> > Post([FromBody] VouchersCreateRequest request) { if (request != null && request.DplNote != null && _authData.GetUserRole() == UserRole.DplEmployee) { request.DplNote.UserId = _authData.GetUserId(); } return(this._vouchersService.Create(request).Convert <Voucher>(this)); }
public async Task <IWrappedResponse> Create(VouchersCreateRequest request) { // Use ServiceCommand to create typically execution pattern var cmd = ServiceCommand <PostingRequest, Rules.Vouchers.Create.MainRule> .Create(_serviceProvider) .When(new Rules.Vouchers.Create.MainRule(request)) .Then(CreateAction); return(await cmd.Execute()); }
public MainRule(VouchersCreateRequest request) { // Create Context Context = new ContextModel(request, this); }