Skip to content

C# Protable Library Client for the Apigee (usergrid) - (.Net 4.5, WP7, WP8 & Win8 Apps)

Notifications You must be signed in to change notification settings

zaxy78/Apigee.Net

 
 

Repository files navigation

Apigee Usergrid SDK for .Net (C#)

This is a Portable Library of C# Client for the Apigee Usergrid : https://apigee.com/usergrid/

This Portable Library is stil in Beta. You are most welcome to fork and conribute!

What's a Portable Library?

Portable library is a .NET binary lib (dll) compatible with few different platforms.

This Apigee.Net ProtLib is compatible with .NET4, .NET 4.5, Win8 Apps & Windows Phone 7.5 and 8. For this to work, Visual Studio combines the beggist set of APIs - which is common to all platforms.

Atleast for now, some features aren't joint, for example to the Networking libraries. This makes it difficult to write this kind of Client, since it's based on HTTP requests.

The solution is simple. Interfaces. heard of it? This Portable Library defiens an IHttpTools interface. this interface supplies us with different Http request Methods. In order to use this Portable Library, you must supply an IHttpTools Implementation, on the constructor. This way we write the Portble Library logic, in terms of handling Apigee calls and models, and each platform, supplies its best way to send the Http requests.

Currently we have IHttpTools Implementations for .Net 4.5 & Windows Phone 7.

All implementations are inside the relevant Sample App.

Try It!

Usage is as follows :

        ApigeeClient apiClient; 
        apiClient = new ApigeeClient("http://api.usergrid.com/xxx/sandbox/", new IHttpToolsImplementation());

        //Get a collection of all users 
        var allUsers = apiClient.GetUsers();

        string un = "apigee_" + Guid.NewGuid();

        //Create a new Account
        apiClient.CreateAccount(new UserModel
        {
            Username = un,
            Password = "abc123",
            Email = un + "@zaxyinc.com"
        });

        //Update an Existing Account
        apiClient.UpdateAccount(new UserModel
        {
            Username = un,
            Password = "abc123456",
            Email = un + "@zaxyinc.com"
        });

        //Login User - Get Token 
        var token = apiClient.GetToken(un, "abc123456");

        //Lookup a user by token ID
        var username = apiClient.LookUpToken(token);

And more & more methods to come. updates every commit.

About

C# Protable Library Client for the Apigee (usergrid) - (.Net 4.5, WP7, WP8 & Win8 Apps)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%