Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/21dimensions/csharp-client

Client for EasyEasy.io cloud database
https://github.com/21dimensions/csharp-client

cloud database databases easyeasy orm orm-framework storage

Last synced: 7 days ago
JSON representation

Client for EasyEasy.io cloud database

Awesome Lists containing this project

README

        

# EasyEasy.Client

## How to use

### Install with Nuget
```
Install-Package EasyEasy.Client
```

### Initialize

```csharp YOUR_APP_KEY
var client = new Client("YOUR_APP_KEY");
```

### Examples

```csharp

class Cat
{
// Id property is required
public string Id { get; set; }

public string Name { get; set; }

public double Age { get; set; }

public IEnumerable Interests { get; set; }
}

/////////////////

var cat = new Cat()
{
Name = "Sam",
Age = 1.5,
Interests = new string[] { "play", "eat" }
};

// add new object
var id = await client.AddAsync(cat);

// get object by id
cat = await client.GetOne(id);

// update
cat.Age = 1.7;
await client.UpdateAsync(cat);

// get filtered array of objects
var cats = await client.GetAsync(new { }); // return all cats
cats = await client.GetAsync(new { age=1.5 }); // 1.5 years old cats
cats = await client.GetAsync(new { age_gt=1.0 }); // cats older than 1 year
cats = await client.GetAsync(new { name_like="Sa*" }); // wildcard

// paging
cats = await client.GetAsync(new { _start = 10, _count = 10 });

//Learn more about filtering operators at: http://easyeasy.io/docs#/operators

//delete
await client.DeleteAsync(cat.Id)
```

# Licence
ISC