예제 #1
0
 public async Task <IActionResult> Put(int id, UpdateFundCommand command)
 {
     if (id != command.Id)
     {
         return(BadRequest());
     }
     return(Ok(await Mediator.Send(command)));
 }
        public Task <Fund> Handle(UpdateFundCommand command)
        {
            var fund = fundRepository.FindById(command.Id);

            fund.Update(command);
            fundRepository.Update(fund);

            return(Task.FromResult(PublishEvent(fund)));
        }
예제 #3
0
        public void Update(UpdateFundCommand command)
        {
            Version++;
            Name         = command.Name;
            Description  = command.Description;
            ModifiedDate = DateTime.Now;
            ModifiedBy   = command.SenderUserName;

            appliedEvents.Add(new FundUpdatedEvent(Id, Name, Description, CreatedDate, ModifiedDate, ModifiedBy));
        }
예제 #4
0
 public FundViewModel Update(UpdateFundCommand command)
 {
     return(mapper
            .Map <FundViewModel>(
                bus.DispatchCommand <UpdateFundCommand, Fund>(command).Result));
 }
예제 #5
0
        public async Task <ActionResult> Update(UpdateFundCommand command)
        {
            await Mediator.Send(command);

            return(NoContent());
        }
예제 #6
0
 public IActionResult Put([FromRoute] Guid id, [FromBody] UpdateFundCommand command)
 {
     return(Ok(fundAppService.Update(command)));
 }