Giter Site home page Giter Site logo

nikhilk / dynamicrest Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 14.0 295 KB

REST service access using C# 4.0 dynamic programming

Home Page: http://www.nikhilk.net/CSharp-Dynamic-Programming-JSON.aspx

License: BSD 3-Clause "New" or "Revised" License

C# 100.00%

dynamicrest's People

Contributors

nikhilk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamicrest's Issues

Found issue when using Credentials

Hey,

I was doing a little playing around with you're code, and when using the Network Credentials, it actually looses the credentials when it remakes the RestClient in the TryGetMember Function in RestClient.cs.

To fix this, I added the following:
if (_credentials != null)
operationGroupClient._credentials = _credentials;

The function as a whole:

      public override bool TryGetMember(GetMemberBinder binder, out object result) {
        if (_parameters == null) {
            _parameters = new Dictionary<string, object>();
        }

        object value;
        if (_parameters.TryGetValue(binder.Name, out value)) {
            result = value;
            return true;
        }

        string operationGroup = binder.Name;
        if (_operationGroup != null) {
            operationGroup = _operationGroup + "." + operationGroup;
        }

        RestClient operationGroupClient =
            new RestClient(_uriFormat, _service, operationGroup, _parameters);

        if (_credentials != null)
            operationGroupClient._credentials = _credentials;

        result = operationGroupClient;
        return true;
    }

Just thought I'd contribute back.

Thank You,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.