public Task <Fund> Handle(CreateFundCommand command) { var fund = new Fund(); fund.Create(command); fundRepository.Insert(fund); return(Task.FromResult(PublishEvent(fund))); }
public void Create(CreateFundCommand command) { Version++; Id = Guid.NewGuid(); Name = command.Name; Description = command.Description; CreatedDate = DateTime.Now; ModifiedBy = command.SenderUserName; appliedEvents.Add(new FundCreatedEvent(Id, Name, Description, CreatedDate, ModifiedDate, ModifiedBy)); }
public async Task <IActionResult> Post(CreateFundCommand command) { return(Ok(await Mediator.Send(command))); }
public FundViewModel Create(CreateFundCommand command) { return(mapper .Map <FundViewModel>( bus.DispatchCommand <CreateFundCommand, Fund>(command).Result)); }
public async Task <ActionResult <int> > Create(CreateFundCommand command) { return(await Mediator.Send(command)); }
public IActionResult Post([FromBody] CreateFundCommand command) { return(Ok(fundAppService.Create(command))); }