コード例 #1
0
        public ListaEntity GetByCodigo([FromServices] IListaRepository repository, string codigo)
        {
            //var user = repository.GetByIdFacebook(idFacebook);

            var result = repository.GetByCodigo(codigo);

            return(result);
        }
コード例 #2
0
        public ICommandResult Handler(GetListByCodigoCommand command)
        {
            command.Validate();
            if (command.Invalid)
            {
                return(new GenericCommandResult(false, "alguma coisa deu errado", command.Notifications));
            }

            var lista = _listaRepository.GetByCodigo(command.Codigo);

            return(new GenericCommandResult(true, "Sucesso", lista));
        }