public GenericCommandResult Put( [FromBody] UpdateResidentCommand command, [FromServices] ResidentHandler handler ) { command.User = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value; var result = (GenericCommandResult)handler.Handle(command); return(result); }
public GenericCommandResult Delete( Guid id, [FromServices] ResidentHandler handler ) { var user = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value; var command = new ActivateResidentCommand(id, user); return((GenericCommandResult)handler.Handle(command)); }
public void Given_Invalid_Command_Result_Success_Should_Be_False() { _result = (GenericCommandResult)_handler.Handle(_invalidCommand); Assert.AreEqual(false, _result.Success); }