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

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

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