Question

Somebody can explain me this code :

auth = new MvcAuthorizer
       {
           Credentials = credentials               
       };

       auth.CompleteAuthorization(Request.Url);



var auth = new MvcAuthorizer
        {
            Credentials = new SessionStateCredentials()
            {
                ConsumerKey = this.client.ConsumerKey,
                ConsumerSecret = this.client.ConsumerSecret,
                OAuthToken = identity.Token.Token
            }
        };

the difference between the two codes

Thanks,

Was it helpful?

Solution

Logically, there is no difference. I'm making the assumption that "credentials" in the first example is a SessionStateCredentials that was instantiated previously in the code. The second example uses object initialization syntax to do the same thing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top