2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00
This commit is contained in:
2019-12-23 11:57:16 +03:00
parent 128972bb74
commit a96ddf602f
12 changed files with 183 additions and 57 deletions

View File

@ -0,0 +1,28 @@
using Esyur.Core;
using Esyur.Data;
using Esyur.Proxy;
using Esyur.Resource;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Esyur.Stores.MongoDB
{
public class MongoDBStore<T> : MongoDBStore where T:IResource
{
[ResourceFunction]
public T Create(string name, Structure values)
{
return Warehouse.New<T>(name, this, null, null, null, null, values);
}
[ResourceFunction]
public async AsyncReply<IResource[]> Slice(int index, int limit)
{
var list = await this.Instance.Children<IResource>();
return list.Skip(index).Take(limit).ToArray();
}
}
}