public async Task <ICommandResult> Handle(CreateDeveloperCommand command) { command.Validate(); if (command.Invalid) { return(new GenericCommandResult(false, "Operação inválida", command.Notifications)); } var developer = _mapper.Map <Developer>(command); await _developerRepository.AddAsync(developer); return(new GenericCommandResult(true, "Desenvolvedor criado com sucesso", developer)); }
public async Task AddAsync() { var result = await DeveloperEntityFramework.AddAsync(builder.CreateDeveloper()); Assert.IsTrue(Guid.TryParse(result.Id.ToString(), out _)); }
public async Task AddDeveloper(Developer developer) { await _repository.AddAsync(developer); }