protected async Task <CreateUnitCommand> CreateUnitAsync(HttpClient client) { var command = new CreateUnitCommand( Guid.NewGuid(), Random.RandomString(50), (await GetLessonListAsync(client)).Random().Id, Random.Next(Grade.Min, Grade.Max)); var response = await client.PostAsync(ApiPath, command.ToJsonContent()); response.EnsureSuccessStatusCode(); return(command); }
public async Task <IActionResult> CreateAsync(CreateUnitCommand command) { await _commandProcessor.SendAsync(command); return(Ok()); }
public async Task <IActionResult> AddUnitAsync(CreateUnitCommand command) { return(Ok(await Mediator.Send(command))); }