public object Post(FilialCommandRegister commad) { if (!string.IsNullOrEmpty(commad.Nome)) { var result = _service.Salvar(commad); if (result != null) { return(result); } } return(new { NotFound = true, message = "Falha ao salvar Filial" }); }
public FilialCommandResultRegister Handle(FilialCommandRegister commad) { if (_repository.ExisteFilial(commad.Nome)) { return(null); } var filial = new Filial( commad.FilialId, commad.Nome, commad.QuantidadeSala ); var result = _repository.Salvar(filial); var commandoResult = new FilialCommandResultRegister( result, commad.Nome ); return(commandoResult); }
public FilialCommandResultRegister Salvar(FilialCommandRegister command) { var result = _handle.Handle(command); return(result); }