public static Faker <CreateMemberCommand> Valid() { return(new Faker <CreateMemberCommand>().CustomInstantiator(x => { var command = new CreateMemberCommand { Name = x.Person.UserName }; const string routename = "get-member"; var urlHelper = UrlHelperMockBuilder.Create().SetupLink(routename).Build(); command.SetupForCreation(urlHelper, routename, x => new { x.Id }); return command; })); }
public async Task <IActionResult> CreateAsync([FromBody] CreateMemberCommand command, CancellationToken cancellationToken) { command.SetupForCreation(Url, "get-member", x => new { id = x.Id }); return(await _mediator.Send(command, cancellationToken)); }