public Task <Fund> Handle(CreateFundCommand command)
        {
            var fund = new Fund();

            fund.Create(command);
            fundRepository.Insert(fund);

            return(Task.FromResult(PublishEvent(fund)));
        }
Пример #2
0
        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));
        }
Пример #3
0
 public async Task <IActionResult> Post(CreateFundCommand command)
 {
     return(Ok(await Mediator.Send(command)));
 }
Пример #4
0
 public FundViewModel Create(CreateFundCommand command)
 {
     return(mapper
            .Map <FundViewModel>(
                bus.DispatchCommand <CreateFundCommand, Fund>(command).Result));
 }
Пример #5
0
 public async Task <ActionResult <int> > Create(CreateFundCommand command)
 {
     return(await Mediator.Send(command));
 }
Пример #6
0
 public IActionResult Post([FromBody] CreateFundCommand command)
 {
     return(Ok(fundAppService.Create(command)));
 }