Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }