mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-06 19:42:58 +00:00
29 lines
711 B
C#
29 lines
711 B
C#
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();
|
|
}
|
|
|
|
}
|
|
}
|