public IActionResult EditPersonalInfo(Guid id, [FromBody] StudentPersonalInfoDto dto) { var command = new EditPersonalInfoCommand(id, dto.Name, dto.Email); var result = _messages.Dispatch(command); return(FromResult(result)); }
public async Task <IActionResult> EditPersonalInfo(long id, [FromBody] StudentPersonalInfoDto dto) { var command = new EditPersonalInfoCommand(id, dto.Name, dto.Email); var result = await _dispatcher.Dispatch(command); return(FromResult(result)); }
public IActionResult UpdatePersonalInfo(long id, [FromBody] StudentPersonalInfoDto dto) { EditPersonalInfoCommand command = new EditPersonalInfoCommand(id, dto.Name, dto.Email); Result result = _messages.Dispatch(command); return(FromResult(result)); }
public IActionResult EditPersonalInfo(long id, [FromBody] StudentPersonalInfoDto dto) { var command = new EditPersonalInfoCommand(id, dto.Name, dto.Email); var result = _messages.Dispatch(command); return(result.IsSuccess ? Ok() : Error(result.Error)); }
public IActionResult EditPersonalInfo(long id, [FromBody] StudentPersonalInfoDto dto) { var command = new EditPersonalInfoCommand(id, dto.Name, dto.Email); //var handler = new EditPersonalInfoCommandHandler(_unitOfWork); //this was before using _messages //Result result = handler.Handle(command); Result result = _messages.Dispatch(command); return(FromResult(result)); }
public IActionResult EditPersonalInfo(long id, [FromBody] StudentPersonalInfoDto dto) { var command = new EditPersonalInfoCommand() { Email = dto.Email, Name = dto.Name, Id = id }; var handler = new EditPersonalInfoCommandHandler(_unitOfWork); var result = handler.Handle(command); return(result.IsSuccess ? Ok() : Error(result.Error)); }