public async Task <EnderecoFuncionario> GetAsync(int id) { this._logger.LogDebug("Starting GetAsync"); this._logger.LogDebug("Retriving a Endereco"); var endereco = await _sqlService.GetAsync <EnderecoFuncionario>(EnderecosFunQuery.GET, new { Id = id }); this._logger.LogDebug("Checking if endereco exists"); if (endereco == null) { this._logger.LogDebug("endereco does not exists, triggering 404"); throw new ArgumentNullException(nameof(id)); } this._logger.LogDebug("Ending GetAsync"); return(endereco); }
public async Task <ServicoFuncionario> GetAsync(int id) { this._logger.LogDebug("Starting GetAsync"); this._logger.LogDebug("Retriving a Funcionario in servico"); var funcionarioServico = await _sqlService.GetAsync <ServicoFuncionario>(ServicoFuncionarioQuery.GET, new { Id = id }); this._logger.LogDebug("Checking if funcionario exists in servico"); if (funcionarioServico == null) { this._logger.LogDebug("funcionario does not exists in servico, triggering 404"); throw new ArgumentNullException(nameof(id)); } this._logger.LogDebug("Ending GetAsync"); return(funcionarioServico); }
public async Task <Servico> GetAsync(int id) { this._logger.LogDebug("Starting GetAsync"); this._logger.LogDebug("Retriving a Servico"); var servico = await _sqlService.GetAsync <Servico>(ServicosQuery.GET, new { Id = id }); this._logger.LogDebug("Checking if servico exists"); if (servico == null) { this._logger.LogDebug("Servico does not exists, triggering 404"); throw new ArgumentNullException(nameof(id)); } this._logger.LogDebug("Ending GetAsync"); return(servico); }
public async Task <Veiculo> GetAsync(int id) { this._logger.LogDebug("Starting GetAsync"); this._logger.LogDebug("Retriving a veiculo"); var veiculo = await _sqlService.GetAsync <Veiculo>(VeiculoQuery.GET, new { Id = id }); this._logger.LogDebug("Checking if product exists"); if (veiculo == null) { this._logger.LogDebug("veiculo does not exists, triggering 404"); throw new ArgumentNullException(nameof(id)); } this._logger.LogDebug("Ending GetAsync"); return(veiculo); }
public async Task <ContatoCliente> GetAsync(int id) { this._logger.LogDebug("Starting GetAsync"); this._logger.LogDebug("Retriving a Funcionario"); var contato = await _sqlService.GetAsync <ContatoCliente>(ContatoClienteQuery.GET, new { Id = id }); this._logger.LogDebug("Checking if product exists"); if (contato == null) { this._logger.LogDebug("Contato does not exists, triggering 404"); throw new ArgumentNullException(nameof(id)); } this._logger.LogDebug("Ending GetAsync"); return(contato); }
public async Task <Product> GetAsync(int codProduct) { this._logger.LogDebug("Starting GetAsync"); this._logger.LogDebug("Retriving a product"); var product = await _sqlService.GetAsync <Product>(ProductQuery.GET, new { CodProduct = codProduct }); this._logger.LogDebug("Checking if product exists"); if (product == null) { this._logger.LogDebug("Product does not exists, triggering 404"); throw new ArgumentNullException(nameof(codProduct)); } this._logger.LogDebug("Ending GetAsync"); return(product); }
public async Task <User> GetAsync(int id) { this._logger.LogDebug("Starting GetAsync"); this._logger.LogDebug("Retriving a user"); var user = await _sqlService.GetAsync <User>(UserQuery.GET, new { Id = id, CreatedBy = _authenticatedService.Token().Subject }); this._logger.LogDebug("Checking if user exists"); if (user == null) { this._logger.LogDebug("User does not exists, triggering 404"); throw new ArgumentNullException(nameof(id)); } this._logger.LogDebug("Ending GetAsync"); return(user); }